-
Notifications
You must be signed in to change notification settings - Fork 72
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: strange potential NPE #568
Conversation
Unexpected error, debug log printed. class java.lang.NullPointerException: Cannot load from object array because "this.this$0.filters" is null java.lang.NullPointerException: Cannot load from object array because "this.this$0.filters" is null at net.sourceforge.kolmafia.swingui.panel.UseItemEnqueuePanel$ConsumableFilterField.isVisible(UseItemEnqueuePanel.java:709) at net.java.dev.spellcast.utilities.LockableListModel.updateSingleFilter(LockableListModel.java:828) at net.java.dev.spellcast.utilities.LockableListModel.updateFilter(LockableListModel.java:801) at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctionsNow(ConcoctionDatabase.java:1332) at net.sourceforge.kolmafia.persistence.ConcoctionDatabase.refreshConcoctions(ConcoctionDatabase.java:1179) at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1353) at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1105) at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:3252) at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:243) at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:208) at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:3027) at jdk.internal.reflect.GeneratedMethodAccessor174.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:63) at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:113) at net.sourceforge.kolmafia.textui.parsetree.Variable.getValue(Variable.java:42) at net.sourceforge.kolmafia.textui.parsetree.VariableReference.execute(VariableReference.java:41) at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:68) at net.sourceforge.kolmafia.textui.parsetree.Variable.getValue(Variable.java:42) at net.sourceforge.kolmafia.textui.parsetree.VariableReference.execute(VariableReference.java:41) at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:68) at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:423) at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:87) at net.sourceforge.kolmafia.textui.AshRuntime.executeScope(AshRuntime.java:254) at net.sourceforge.kolmafia.textui.AshRuntime.execute(AshRuntime.java:182) at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:147) at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:115) at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:89) at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:3162) at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:243) at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:208) at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:455) at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:103) at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:82)
Codecov Report
@@ Coverage Diff @@
## main #568 +/- ##
=========================================
Coverage 20.36% 20.37%
- Complexity 8589 8596 +7
=========================================
Files 998 998
Lines 155995 155996 +1
Branches 34703 34704 +1
=========================================
+ Hits 31775 31788 +13
+ Misses 118297 118292 -5
+ Partials 5923 5916 -7
Continue to review full report at Codecov.
|
Think it was probably a race condition: if the code runs while the outer constructor is in progress, that would explain it. |
Occured when doing something in the relay browser while having the consumables pop-up open, once.
"strange" because I can't see how this could happen -- the null field is non-static and populated in the constructor, and you can't only have the filter field without the rest of it... I think?
Anyway, checking for null should make it no longer happen.