Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Essentials/Commands/CleanupModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,16 @@ public bool OwnedBy(MyCubeGrid grid, string str)
{
var player = Utilities.GetPlayerByNameOrId(str);
if (player == null)
{
if(long.TryParse(str, out long NPCId))
{
if(MySession.Static.Players.IdentityIsNpc(NPCId))
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll get a null reference exception if this statement is false. Remove the else on L291

return grid.BigOwners.Contains(NPCId);
}
}
return false;

}
identityId = player.IdentityId;
}

Expand Down