Skip to content

Commit

Permalink
Fix null reference exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Tkael committed Aug 19, 2024
1 parent 7ba01cb commit 8c5a495
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CargoMonitor/CargoMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ private void AddOrUpdateCargo(Cargo cargo)

private bool TryRemoveCargo ( Cargo cargo )
{
if ( ( cargo.total + cargo.need ) < 1 )
if ( cargo != null && ( cargo.total + cargo.need ) < 1 )
{
// All of the commodity was either expended, ejected, or sold
_RemoveCargoWithEDName( cargo.edname );
Expand Down

0 comments on commit 8c5a495

Please sign in to comment.