Skip to content

Commit

Permalink
Added warning for missing streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Mar 2, 2016
1 parent c825638 commit 8250e59
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/restartable.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ export default function restartable (driver, opts = {}) {
newLog$.take(1).subscribe(newLog => {
function scheduleEvent (historicEvent) {
scheduler.scheduleAbsolute({}, historicEvent.time, () => {
streams[historicEvent.identifier].onNext(historicEvent.event);
if (streams[historicEvent.identifier]) {
streams[historicEvent.identifier].onNext(historicEvent.event);
} else {
console.error('Missing replay stream ', historicEvent.identifier)
}
});
}

Expand Down

0 comments on commit 8250e59

Please sign in to comment.