diff --git a/display.js b/display.js
index d9bdd9fd615fdf4fca21ab5d2b6fdd78ee0ff545..e26bff8ec412f4d37f372c010661be598393619e 100644
--- a/display.js
+++ b/display.js
@@ -963,8 +963,8 @@ function handle_draw_jpeg_onload()
         this.o.sc.surfaces[this.o.base.surface_id].draw_count++;
     }
 
-    if ("report" in this.o.sc.streams[this.o.id])
-            process_stream_data_report(this.o.sc, this.o.id, this.o.msg_mmtime, this.o.msg_mmtime - this.o.sc.parent.relative_now())
+    if (this.o.sc.streams[this.o.id] && "report" in this.o.sc.streams[this.o.id])
+        process_stream_data_report(this.o.sc, this.o.id, this.o.msg_mmtime, this.o.msg_mmtime - this.o.sc.parent.relative_now());
 }
 
 function process_mjpeg_stream_data(sc, m, time_until_due)