RemoveCommand: Add null check for ent ptr.