Skip to content

Commit 027864d

Browse files
authored
Fix crash AssertNotNull (wix#2148)
1 parent 9e282d6 commit 027864d

File tree

1 file changed

+6
-2
lines changed
  • lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils

1 file changed

+6
-2
lines changed

lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ public void run() {
1414
};
1515

1616
public static void runOnUIThread(Runnable runnable) {
17-
ReactContextHolder.getContext().runOnUiQueueThread(runnable);
17+
if (ReactContextHolder.getContext() != null) {
18+
ReactContextHolder.getContext().runOnUiQueueThread(runnable);
19+
}
1820
}
1921

2022
public static void dispatchUIUpdates(final Runnable userRunnable) {
2123
runOnUIThread(new Runnable() {
2224
@Override
2325
public void run() {
2426
userRunnable.run();
25-
ReactContextHolder.getContext().runOnNativeModulesQueueThread(sUIUpdateClosure);
27+
if (ReactContextHolder.getContext() != null) {
28+
ReactContextHolder.getContext().runOnNativeModulesQueueThread(sUIUpdateClosure);
29+
}
2630
}
2731
});
2832
}

0 commit comments

Comments
 (0)