Fix segmentation fault when an entity could not be deserialized.