@@ -8286,37 +8286,41 @@ JAVA_BOOLEAN com_codename1_impl_ios_IOSNative_nativeIsAlphaMaskSupportedGlobal__
8286
8286
JAVA_INT com_codename1_impl_ios_IOSNative_getDisplaySafeInsetLeft___R_int(CN1_THREAD_STATE_MULTI_ARG JAVA_OBJECT instanceObject) {
8287
8287
if (@available(iOS 11.0, *)) {
8288
8288
UIWindow *window = UIApplication.sharedApplication.keyWindow;
8289
- return (JAVA_INT)( window.safeAreaInsets.left * scaleValue);
8290
- } else {
8291
- return 0;
8289
+ if( window != nil && window .safeAreaInsets != nil) {
8290
+ return (JAVA_INT)(window.safeAreaInsets.left * scaleValue);
8291
+ }
8292
8292
}
8293
+ return 0;
8293
8294
}
8294
8295
8295
8296
JAVA_INT com_codename1_impl_ios_IOSNative_getDisplaySafeInsetTop___R_int(CN1_THREAD_STATE_MULTI_ARG JAVA_OBJECT instanceObject) {
8296
8297
if (@available(iOS 11.0, *)) {
8297
8298
UIWindow *window = UIApplication.sharedApplication.keyWindow;
8298
- return (JAVA_INT)( window.safeAreaInsets.top * scaleValue);
8299
- } else {
8300
- return 0;
8299
+ if( window != nil && window .safeAreaInsets != nil) {
8300
+ return (JAVA_INT)(window.safeAreaInsets.top * scaleValue);
8301
+ }
8301
8302
}
8303
+ return 0;
8302
8304
}
8303
8305
8304
8306
JAVA_INT com_codename1_impl_ios_IOSNative_getDisplaySafeInsetRight___R_int(CN1_THREAD_STATE_MULTI_ARG JAVA_OBJECT instanceObject) {
8305
8307
if (@available(iOS 11.0, *)) {
8306
8308
UIWindow *window = UIApplication.sharedApplication.keyWindow;
8307
- return (JAVA_INT)( window.safeAreaInsets.right * scaleValue);
8308
- } else {
8309
- return 0;
8309
+ if( window != nil && window .safeAreaInsets != nil) {
8310
+ return (JAVA_INT)(window.safeAreaInsets.right * scaleValue);
8311
+ }
8310
8312
}
8313
+ return 0;
8311
8314
}
8312
8315
8313
8316
JAVA_INT com_codename1_impl_ios_IOSNative_getDisplaySafeInsetBottom___R_int(CN1_THREAD_STATE_MULTI_ARG JAVA_OBJECT instanceObject) {
8314
8317
if (@available(iOS 11.0, *)) {
8315
8318
UIWindow *window = UIApplication.sharedApplication.keyWindow;
8316
- return (JAVA_INT)( window.safeAreaInsets.bottom * scaleValue);
8317
- } else {
8318
- return 0;
8319
+ if( window != nil && window .safeAreaInsets != nil) {
8320
+ return (JAVA_INT)(window.safeAreaInsets.bottom * scaleValue);
8321
+ }
8319
8322
}
8323
+ return 0;
8320
8324
}
8321
8325
8322
8326
JAVA_INT com_codename1_impl_ios_IOSNative_getDisplayWidth___R_int(CN1_THREAD_STATE_MULTI_ARG JAVA_OBJECT instanceObject) {
0 commit comments