You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by no...@apache.org on 2011/04/28 18:15:09 UTC

svn commit: r1097527 - /pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java

Author: noelgrandin
Date: Thu Apr 28 16:15:09 2011
New Revision: 1097527

URL: http://svn.apache.org/viewvc?rev=1097527&view=rev
Log:
fix potential null pointer access

Modified:
    pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java

Modified: pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java
URL: http://svn.apache.org/viewvc/pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java?rev=1097527&r1=1097526&r2=1097527&view=diff
==============================================================================
--- pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java (original)
+++ pivot/trunk/core/src/org/apache/pivot/beans/BeanAdapter.java Thu Apr 28 16:15:09 2011
@@ -298,9 +298,11 @@ public class BeanAdapter implements Map<
             }
 
             Class<?> fieldType = field.getType();
-            Class<?> valueType = value.getClass();
-            if (!fieldType.isAssignableFrom(valueType)) {
-                value = coerce(value, fieldType);
+            if (value != null) {
+                Class<?> valueType = value.getClass();
+                if (!fieldType.isAssignableFrom(valueType)) {
+                    value = coerce(value, fieldType);
+                }
             }
 
             try {