Skip to content

Commit

Permalink
fix: add defensive check in GetBattlegroundsAnomalyDbfId
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Aug 23, 2023
1 parent 185aa22 commit 4fbd286
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Hearthstone Deck Tracker/Hearthstone/BattlegroundsUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ private static HashSet<Race>? AvailableRaces
_ => new HashSet<int> { 1, 2, 3, 4, 5, 6 },
};

public static int? GetBattlegroundsAnomalyDbfId(Entity game)
public static int? GetBattlegroundsAnomalyDbfId(Entity? game)
{
if(game == null) return null; // defensive to protect against wrong type of Core.Game.GameEntity
var anomalyDbfId = game.GetTag(GameTag.BACON_GLOBAL_ANOMALY_DBID);
if (anomalyDbfId > 0)
return anomalyDbfId;
Expand Down

0 comments on commit 4fbd286

Please sign in to comment.