Fix error on deploy when entity is none