From 8250e594cff7d8625e1e765710f41b08e389a587 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 2 Mar 2016 23:55:39 +0100 Subject: [PATCH] Added warning for missing streams. --- src/restartable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/restartable.js b/src/restartable.js index 0fdf39c..792f944 100644 --- a/src/restartable.js +++ b/src/restartable.js @@ -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) + } }); }