-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix potential NPE in UIViewOperationQueue. #11428
Fix potential NPE in UIViewOperationQueue. #11428
Conversation
looks good to me |
This would imply that somewhere we're adding null to the queue. A better fix would be to never allow null to be added to the queue -- there's no reason I can think of that we'd ever want that. |
@astreet makes sense, though a bit time constrained at the moment, probably won't be able to find the root cause anytime soon. Shall I close this PR and open an issue? |
There's nothing that I can see that could add null to the operations queue in open source -- do you have any non-open source usages of UIViewOperationQueue#enqueueUIOperation? All other add calls I can see add a new object that can't be null. I'm worried we might be hiding a bug somewhere (in our code or yours) or could hide a bug in the future. |
@astreet I think this is worth investigating. Our code is unfortunately not open source, but as soon as I can reproduce this consistently, I will either fix the bug or put together a sample app that causes the error. |
So weird - I'm not seeing any calls to
|
Alright, thanks for following up. Not saying it can't somehow be a bug in OSS, but we haven't had this crop up for any of our apps at FB AFAICT |
NP - will try to spend some time on this today and hopefully will find something. Cheers. |
…o android_uiviewoperationqueue_npe
@astreet unfortunately didn't get to the bottom of this. However, I updated this PR to include a null check for the |
@astreet any thoughts on this PR? This is currently our most common crash on Android, so your help is much appreciated. |
Instead of a null-check, I'm fine adding |
@@ -778,8 +780,8 @@ public void run() { | |||
} | |||
|
|||
if (operations != null) { | |||
for (int i = 0; i < operations.size(); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this change since it's not relevant.
…o android_uiviewoperationqueue_npe
@astreet updated, thanks! |
@facebook-github-bot shipit |
Thanks! |
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
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 facebook#11428 Differential Revision: D4487841 Pulled By: astreet fbshipit-source-id: ae49ef77967edea7514cbf40cb533c4b63fd34ae
@astreet After reexamining this problem this issue isn't due to adding null to mOperations, its due to mutating mOperations from the main UI thread. The SoftAssertion here probably isn't doing anything. I'd like to add SOMETHING to help people in the future, but I'm not certain what. |
Actually the issues isn't the main thread, its any thread other than the native_modules thread. asserting on |
This is happening to me @dmueller39 and It's driving me mad. I opened #27819. I see no way that mOperations can get a null reference put into it. I searched my whole node_modules looking for things that call enqueueUIOperation and there are none. This crash is happening for lots of my users =( |
@manicakes I had to fork and re-add your change of if(op !== null) since things were still crashing frequently without it. As @dmueller39 said the SoftAssertion doesn't appear to do anything. I still haven't been able to figure out the root cause of the issue, but my app seems to run fine with the extra null check. |
We were noticing the following crash in our application, that was occurring fairly often, but still hard to reproduce:
Looks like we may have
null
objects in theUIViewOperationQueue
. I went ahead and put in null checks in the relevant places.