Skip to content

Commit

Permalink
Fixes a crash in RulesClassExtension::Fixup if HouseTypes had a count…
Browse files Browse the repository at this point in the history
… of zero.
  • Loading branch information
CCHyper committed Feb 22, 2023
1 parent 37105d4 commit 590971f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/extensions/rules/rulesext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,10 @@ void RulesClassExtension::Fixups(CCINIClass &ini)

}

HouseTypeClass *housetype = HouseTypes[HOUSE_NOD];
/**
* Ensure at least two HouseTypes are defined before performing this fixup case.
*/
HouseTypeClass *housetype = HouseTypes.Count() >= 2 ? HouseTypes[HOUSE_NOD] : nullptr;
if (housetype) {

/**
Expand Down

0 comments on commit 590971f

Please sign in to comment.