Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstanc...
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2005 00:09:47 +0000 (00:09 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2005 00:09:47 +0000 (00:09 +0000)
Correctly handle accessing nil objects from a Java object array.

        Reviewed by John.

        * bindings/jni/jni_runtime.cpp:
        (JavaArray::valueAt):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9102 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/bindings/jni/jni_runtime.cpp

index ea253cdde62c216cf5b2d806b50ac3a6d1811b52..496bb784fa39321a2c9dda8c4facc8d649f15e86 100644 (file)
@@ -1,3 +1,14 @@
+2005-05-03  Richard Williamson   <rjw@apple.com>
+
+       Fixed <rdar://problem/4102644> Crash in LiveConnect below KJS::Bindings::JavaInstance::stringValue() const
+
+       Correctly handle accessing nil objects from a Java object array.
+
+        Reviewed by John.
+
+        * bindings/jni/jni_runtime.cpp:
+        (JavaArray::valueAt):
+
 2005-05-01  Darin Adler  <darin@apple.com>
 
         - move to Xcode native targets and stop checking in generated files
index 98b1994d1553255c78e49e9ffeaca72cfc32b5cf..0f8fd310337af2e54a4271c2a8f3dd5c3c05bd40 100644 (file)
@@ -472,12 +472,17 @@ KJS::Value JavaArray::valueAt(KJS::ExecState *exec, unsigned int index) const
             jobject anObject;
             anObject = env->GetObjectArrayElement(objectArray, index);
 
+            // No object?
+            if (!anObject) {
+                return Null();
+            }
+            
             // Nested array?
             if (_type[1] == '[') {
                 return JavaArray::convertJObjectToArray (exec, anObject, _type+1, executionContext());
             }
             // or array of other object type?
-           return Instance::createRuntimeObject(Instance::JavaLanguage, anObject, executionContext());
+            return Instance::createRuntimeObject(Instance::JavaLanguage, anObject, executionContext());
         }
             
         case boolean_type: {