From 8ee41d30dd8a76b3b0cb93220cc2dd08a90a7656 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Thu, 6 Aug 2020 17:41:31 +0200 Subject: [PATCH] src: Fix crash on load Signed-off-by: Philippe Coval Change-Id: Ieb76a5a9f15f6689dd5abb901cdaf911a6a2192c --- data/gnu/ModuleGnu.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/data/gnu/ModuleGnu.cpp b/data/gnu/ModuleGnu.cpp index 70751c5..70bd620 100644 --- a/data/gnu/ModuleGnu.cpp +++ b/data/gnu/ModuleGnu.cpp @@ -64,7 +64,9 @@ */ class GnuBehavior : public Behavior { public: - GnuBehavior() : Behavior() { + GnuBehavior() : Behavior(), + m_iMultiplier{} + { char name[32]; //this->clear(); Loader * loader = Loader::getInstance(); @@ -671,11 +673,13 @@ class GnuBehavior : public Behavior { SendSignal( m_sigLockArrowBlink[i][1], 0, this->getParent(), NULL ); } ElseOnSignal( PBL_SIG_BALL_ON ) { - Table * table = Table::getInstance(); - for (int i = 0; i < MAX_BALL; i++) - { - BallGroup *ballgroup = table->getBall(i); - ballgroup->getShape3D(0)->setColor(1, 1, 1, 1); + Table * table = Table::getInstance(); + for (int i = 0; i < MAX_BALL; i++) { + Shape3D * shape = NULL; + BallGroup * group = NULL; + if (table) group = table->getBall(i); + if (group) shape = group->getShape3D(0); + if (shape) shape->setColor(1, 1, 1, 1); } } ElseOnSignal( m_sigFreeballTarget) {