Fix potential NPE in UIViewOperationQueue.
Summary: We were noticing the following crash in our application, that was occurring fairly often, but still hard to reproduce: ``` 12-12 10:37:35.342: E/AndroidRuntime(9064): FATAL EXCEPTION: main 12-12 10:37:35.342: E/AndroidRuntime(9064): Process: com.bloomberg.android.plus, PID: 9064 12-12 10:37:35.342: E/AndroidRuntime(9064): java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.uimanager.UIViewOperationQueue$UIOperation.execute()' on a null object reference 12-12 10:37:35.342: E/AndroidRuntime(9064): at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:782) 12-12 10:37:35.342: E/AndroidRuntime(9064): at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:829) 12-12 10:37:35.342: E/AndroidRuntime(9064): at com.facebook.react.uimanager.UIViewOperationQueue.access$1500(UIViewOperationQueue.java:44) 12-12 10:37:35.342: E/AndroidRuntime(9064): at com.facebook.react.uimanager.UIViewOperationQ Closes https://github.com/facebook/react-native/pull/11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
This commit is contained in:
parent
29616e3122
commit
cfb90284d6
|
@ -25,6 +25,7 @@ import com.facebook.react.bridge.SoftAssertions;
|
|||
import com.facebook.react.bridge.ReactContext;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.SoftAssertions;
|
||||
import com.facebook.react.bridge.UiThreadUtil;
|
||||
import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener;
|
||||
import com.facebook.systrace.Systrace;
|
||||
|
@ -589,6 +590,7 @@ public class UIViewOperationQueue {
|
|||
* subclass to support UIOperations not provided by UIViewOperationQueue.
|
||||
*/
|
||||
protected void enqueueUIOperation(UIOperation operation) {
|
||||
SoftAssertions.assertNotNull(operation);
|
||||
mOperations.add(operation);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue