Skip to content

Commit

Permalink
refactor: use an explicit null check
Browse files Browse the repository at this point in the history
Because we never want the table inside the WeakTableRef to be possible to be null in this case, so it's better to throw an error in that case.
  • Loading branch information
LordMidas committed Mar 2, 2023
1 parent dc93557 commit a75ea82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion msu/hooks/items/item_container.nut
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

local actionCost = this.getActionCost(_items);
this.m.Actor.setActionPoints(::Math.max(0, this.m.Actor.getActionPoints() - actionCost));
this.m.Actor.getSkills().onPayForItemAction(::MSU.isNull(this.m.ActionSkill) ? null : this.m.ActionSkill.get(), _items);
this.m.Actor.getSkills().onPayForItemAction(this.m.ActionSkill == null ? null : this.m.ActionSkill.get(), _items);
this.m.ActionSkill = null;
}

Expand Down

0 comments on commit a75ea82

Please sign in to comment.