There is few post how to use isNullorempty but never managed to work
Im getting Json object , loop though it , but when i have null value or missing properties
i got this msg “If: Object reference not set to an instance of an object” which is normal,
but couldnt figure out how to skip it (i have a flag need to change the value of its null or empty)
Basically what you need to do is, Check for specific keys if they exist or not in the JObject, if the key does exist, basis that you need to consider whether is coming with isNullOrEmpty to determine blank/no values for the key.
The AndAlso operator will ONLY process the part after it if the part before it is true. So if the someKey key doesn’t exist, (ContainsKey returns false) then the IsNullOrEmpty won’t throw the object reference error.