Skip to content

Commit

Permalink
fix: Correct SonarCloud issue
Browse files Browse the repository at this point in the history
- Access to field 'game' results in a dereference of a null pointer (loaded from field 'm_owner')
  • Loading branch information
utilForever committed Apr 18, 2023
1 parent 8d47b89 commit 9560500
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/Rosetta/PlayMode/Triggers/Trigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,18 @@ std::shared_ptr<Trigger> Trigger::Activate(Playable* source,

void Trigger::Remove()
{
if (m_isRemoved)
if (m_isRemoved || !m_owner)
{
return;
}

Game* game = m_owner->game;

if (!game)
{
return;
}

switch (m_triggerType)
{
case TriggerType::GAME_START:
Expand Down

0 comments on commit 9560500

Please sign in to comment.