Issue #3085476 by benstallings: Avoid TypeError in processEntityIds() when an entity has been deleted