From 10c2055faf4e4194cf004efa73700a8f64b4c550 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 11 Jun 2020 00:59:24 +0200 Subject: [PATCH] DIRECTOR: LINGO: Do not crash during tests on 'set the stageColor' --- engines/director/lingo/lingo-the.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 390880c5316..9a3daf4ab5b 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -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: