Fix accessing null in EntityType.