From 7ec65a3625c0c88d47e535f6195b2ff309e8755f Mon Sep 17 00:00:00 2001 From: falsycat Date: Mon, 7 Oct 2019 00:00:00 +0000 Subject: [PATCH] [fix] Fixed an issue that couldn't run script without elements. --- sjplayer/src/sjplayer/ScheduledControllerFactory.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sjplayer/src/sjplayer/ScheduledControllerFactory.d b/sjplayer/src/sjplayer/ScheduledControllerFactory.d index ceaa067..0abd2f6 100644 --- a/sjplayer/src/sjplayer/ScheduledControllerFactory.d +++ b/sjplayer/src/sjplayer/ScheduledControllerFactory.d @@ -56,7 +56,9 @@ struct ElementScheduledControllerFactory(ScheduledController, ElementDrawer) builder.AddScheduledController( new ScheduledController(element, varstore_, serial)); } - builder.AddElementDrawer(new ElementDrawer(program_, elements[])); + if (elements[].length > 0) { + builder.AddElementDrawer(new ElementDrawer(program_, elements[])); + } } private: