Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
2556:d2d8c66ad062 | 2557:756331246f94 |
---|---|
822 var retval: Long = 0L | 822 var retval: Long = 0L |
823 | 823 |
824 if (window.tag != null) { | 824 if (window.tag != null) { |
825 var dataArrayMap: SimpleArrayMap<String, Long> = window.tag as SimpleArrayMap<String, Long> | 825 var dataArrayMap: SimpleArrayMap<String, Long> = window.tag as SimpleArrayMap<String, Long> |
826 | 826 |
827 retval = dataArrayMap.get(name)!! | 827 if(dataArrayMap.containsKey(name)) { |
828 retval = dataArrayMap.get(name)!! | |
829 } | |
828 } | 830 } |
829 return retval | 831 return retval |
830 } | 832 } |
831 | 833 |
832 fun windowSetEnabled(window: View, state: Boolean) { | 834 fun windowSetEnabled(window: View, state: Boolean) { |