[fix] Fixed an issue that couldn't run script without elements.

This commit is contained in:
falsycat 2019-10-07 00:00:00 +00:00
parent f8c1793dfc
commit 7ec65a3625

View File

@ -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: