Object reference not set to an instance of an object.
Hi,
I've upgraded from Umbraco 7.3 to 7.12.4.
Everything worked perfectly, BUT:
from some reason the site itself stopped working. I'm getting
'Object reference not set to an instance of an object.' on
and basically on every line in my code that has the "GetPropertyValue".
When debugging, I can see that instead of returning the value, the "GetPropertyValue" returns the type:
An Object is an instance of a Class , it is stored some where in memory. A reference is what is used to describe the pointer to the memory location where the Object resides. The message "object reference not set to an instance of an object" (NullReferenceException) means that you are referring to an object the does not exist or was deleted or cleaned up. In order to prevent the error, objects that could be null should be tested for null before being used.
if (mClass != null)
{
// Go ahead and use mClass
mClass.property = ...
}
else
{
// Attempting to use mClass here will result in NullReferenceException
}
A NullReferenceException typically reflects developer error and is thrown in the following scenarios:
Forgotten to instantiate a reference type.
Forgotten to dimension an array before initializing it.
Is thrown by a method that is passed null.
Get a null return value from a method, then call a method on the
returned type.
Using an expression to retrieve a value and, although checking
whether the value is null.
Enumerating the elements of an array that contains reference
types, and attempt to process one of the elements.
Object reference not set to an instance of an object.
Hi, I've upgraded from Umbraco 7.3 to 7.12.4.
Everything worked perfectly, BUT: from some reason the site itself stopped working. I'm getting 'Object reference not set to an instance of an object.' on
and basically on every line in my code that has the "GetPropertyValue". When debugging, I can see that instead of returning the value, the "GetPropertyValue" returns the type:
I'm sure it's web.config related, but I cannot seem to find the culprit.
Please help, Thanks, Rotem
Update: it only happens on macro-partials
Hi Rotem
What property editor do you use in "testifierName" property?
Alex
Hi Alex, Not sure I understood. What do u mean by that? can you please elaborate?
Problem solved. What I did was to set EnablePropertyValueConverters to false:
it has to do with Property Value Converters:
https://our.umbraco.com/documentation/getting-started/setup/upgrading/version-specific#property-value-converters
An Object is an instance of a Class , it is stored some where in memory. A reference is what is used to describe the pointer to the memory location where the Object resides. The message "object reference not set to an instance of an object" (NullReferenceException) means that you are referring to an object the does not exist or was deleted or cleaned up. In order to prevent the error, objects that could be null should be tested for null before being used.
A NullReferenceException typically reflects developer error and is thrown in the following scenarios:
is working on a reply...