diff options
author | Ľubomír Remák | 2018-08-27 20:07:53 +0200 |
---|---|---|
committer | Ľubomír Remák | 2018-08-27 20:07:53 +0200 |
commit | 26445f4c26b1260a1020c759a6f517f1445c3498 (patch) | |
tree | a97464e9efa1615350c6248d23c3bf1519dff5e4 /engines/mutationofjb | |
parent | d0a5da8c895a06a4179002eb80580364e6f2161b (diff) | |
download | scummvm-rg350-26445f4c26b1260a1020c759a6f517f1445c3498.tar.gz scummvm-rg350-26445f4c26b1260a1020c759a6f517f1445c3498.tar.bz2 scummvm-rg350-26445f4c26b1260a1020c759a6f517f1445c3498.zip |
MUTATIONOFJB: Fix Coverity issues.
Diffstat (limited to 'engines/mutationofjb')
-rw-r--r-- | engines/mutationofjb/gui.cpp | 4 | ||||
-rw-r--r-- | engines/mutationofjb/inventory.h | 2 | ||||
-rw-r--r-- | engines/mutationofjb/mutationofjb.cpp | 1 | ||||
-rw-r--r-- | engines/mutationofjb/tasks/conversationtask.cpp | 3 |
4 files changed, 9 insertions, 1 deletions
diff --git a/engines/mutationofjb/gui.cpp b/engines/mutationofjb/gui.cpp index 6266ff0c75..7c219bc706 100644 --- a/engines/mutationofjb/gui.cpp +++ b/engines/mutationofjb/gui.cpp @@ -64,7 +64,9 @@ enum { Gui::Gui(Game &game, Graphics::Screen *screen) : _game(game), - _screen(screen) {} + _screen(screen), + _inventoryWidget(nullptr), + _conversationWidget(nullptr) {} Gui::~Gui() { for (Common::Array<Widget *>::iterator it = _widgets.begin(); it != _widgets.end(); ++it) { diff --git a/engines/mutationofjb/inventory.h b/engines/mutationofjb/inventory.h index 79a0d7583d..d75ef5a674 100644 --- a/engines/mutationofjb/inventory.h +++ b/engines/mutationofjb/inventory.h @@ -45,6 +45,8 @@ public: typedef Common::Array<Common::String> Items; + Inventory() : _observer(nullptr) {} + const Items &getItems() const; bool hasItem(const Common::String &item) const; void addItem(const Common::String &item); diff --git a/engines/mutationofjb/mutationofjb.cpp b/engines/mutationofjb/mutationofjb.cpp index 376c02427c..dec3ab8f97 100644 --- a/engines/mutationofjb/mutationofjb.cpp +++ b/engines/mutationofjb/mutationofjb.cpp @@ -45,6 +45,7 @@ MutationOfJBEngine::MutationOfJBEngine(OSystem *syst) : Engine(syst), _console(nullptr), _screen(nullptr), + _game(nullptr), _mapObjectId(0), _cursorState(CURSOR_IDLE) { diff --git a/engines/mutationofjb/tasks/conversationtask.cpp b/engines/mutationofjb/tasks/conversationtask.cpp index 5b0f0f42f0..9c3ae4b8d8 100644 --- a/engines/mutationofjb/tasks/conversationtask.cpp +++ b/engines/mutationofjb/tasks/conversationtask.cpp @@ -113,6 +113,9 @@ void ConversationTask::showChoicesOrPick() { Game &game = getTaskManager()->getGame(); GameData &gameData = game.getGameData(); Scene *const scene = gameData.getScene(_sceneId); + if (!scene) { + return; + } Common::Array<uint32> itemsWithValidQuestions; Common::Array<uint32> itemsWithValidResponses; |