Skip to content

Commit 43bb4cf

Browse files
authored
simulation filter may include null, include check (#210)
1 parent 253b463 commit 43bb4cf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@simulacrum/server': patch
3+
---
4+
5+
The simulation server can return null events on shutdown, and the logger did not consider this. Check for undefined within the filter.

packages/server/src/effects/logging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function createLogger(slice: Slice<ServerState>): Operation<void> {
1515
yield task.halt();
1616
if (shouldLogErrors) {
1717
task = yield spawn(map(slice.slice("simulations"), function*(simulation) {
18-
yield simulation.filter(({ status }) => status === 'failed').forEach(state => {
18+
yield simulation.filter(sim => sim?.status === 'failed').forEach(state => {
1919
assert(state.status === 'failed');
2020
console.error(state.error);
2121
});

0 commit comments

Comments
 (0)