Browse Source

Fixing NRE when setting properties to null

Sébastien Ros 10 years ago
parent
commit
273ef77a54
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Jint/Runtime/Descriptors/Specialized/PropertyInfoDescriptor.cs

+ 1 - 1
Jint/Runtime/Descriptors/Specialized/PropertyInfoDescriptor.cs

@@ -38,7 +38,7 @@ namespace Jint.Runtime.Descriptors.Specialized
                 {
                     // attempt to convert the JsValue to the target type
                     obj = currentValue.ToObject();
-                    if (obj.GetType() != _propertyInfo.PropertyType)
+                    if (obj != null && obj.GetType() != _propertyInfo.PropertyType)
                     {
                         obj = _engine.ClrTypeConverter.Convert(obj, _propertyInfo.PropertyType, CultureInfo.InvariantCulture);
                     }