Converting and checking only if property value is not null or undefined