DIRECTOR: LINGO: Do not crash during tests on 'set the stageColor'

This commit is contained in:
Eugene Sandulenko committed 2020-06-11 00:59:56 +02:00
1 parent 4fc151caf1
commit 10c2055faf
1 file changed
+6 -2
+6 -2
View File
@@ -631,8 +631,12 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
case kTheStageColor: {
Score *score = _vm->getCurrentScore();
score->_stageColor = d.asInt();
score->_surface->clear(score->_stageColor);
score->renderFrame(score->getCurrentFrame(), true);
if (score->_surface) {
score->_surface->clear(score->_stageColor);
score->renderFrame(score->getCurrentFrame(), true);
} else {
warning("setStageColor: score has no surface, skipping");
}
}
break;
case kTheSprite: