diff android/DWindows.kt @ 2557:756331246f94

Android: Implement Java exception handling, make sure all return values from JNI are sane. This allows you to break in _dw_jni_check_exception() on or before return TRUE to catch any Java exceptions, otherwise they will be cleared and the functions will return failure. Fix the NullPointerException from the last commit, it was in windowGetData with a non existant key in the data SimpleArrayMap.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 17 May 2021 21:11:40 +0000
parents d2d8c66ad062
children ebc6a4ff5f1f
line wrap: on
line diff
--- a/android/DWindows.kt	Sun May 16 22:41:50 2021 +0000
+++ b/android/DWindows.kt	Mon May 17 21:11:40 2021 +0000
@@ -824,7 +824,9 @@
         if (window.tag != null) {
             var dataArrayMap: SimpleArrayMap<String, Long> = window.tag as SimpleArrayMap<String, Long>
 
-            retval = dataArrayMap.get(name)!!
+            if(dataArrayMap.containsKey(name)) {
+                retval = dataArrayMap.get(name)!!
+            }
         }
         return retval
     }