Fix potential nullptr dereference (#15134)

This commit is contained in:
ζeh Matt 2021-07-30 10:33:48 -07:00 committed by GitHub
parent 62d66ca9d0
commit 43b7c3a204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -266,7 +266,10 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const
isTree);
if (canBuild->Error != GameActions::Status::Ok)
{
DeleteBanner(banner->id);
if (banner != nullptr)
{
DeleteBanner(banner->id);
}
canBuild->ErrorTitle = STR_CANT_POSITION_THIS_HERE;
return canBuild;
}