Fix null pointer when entity values are null