fix nullref in GetFieldsAndProperties