Bug - Fixed NPE when visiting Lemon Party Slot with ten-leaf clover

heeheehee

Developer
Staff member
To be more precise, the debug log is printed after clicking on the Lemon Party Slot (in relay browser), when the clover protect screen shows up. This seems like it'd occur in non-adventure.php locations (perhaps? don't have any other locations to test with), since Misspelled Cemetary (adventure.php) does not trigger said NPE.

I've encountered this a few times in the past few days and finally decided to write up a bug report.

Code:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
           KoLmafia v14.8 r10206, Linux, Java 1.6.0_22
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Please note: do not post this log in the KoLmafia thread. If you
 would like the dev team to look at it, please write a bug report
 at kolmafia.us. Include specific information about what you were 
 doing when you made this and include the log as an attachment.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Timestamp: Sat Jan 07 13:00:04 PST 2012
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
        at net.sourceforge.kolmafia.request.RelayRequest.pseudoResponse(RelayRequest.java:467)
        at net.sourceforge.kolmafia.request.RelayRequest.sendCloverWarning(RelayRequest.java:1261)
        at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:1777)
        at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:90)
        at net.sourceforge.kolmafia.textui.RuntimeLibrary.visit_url(RuntimeLibrary.java:1707)
        at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at net.sourceforge.kolmafia.textui.parsetree.LibraryFunction.execute(LibraryFunction.java:127)
        at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:167)
        at net.sourceforge.kolmafia.textui.parsetree.FunctionCall.execute(FunctionCall.java:105)
        at net.sourceforge.kolmafia.textui.parsetree.BasicScope.execute(BasicScope.java:454)
        at net.sourceforge.kolmafia.textui.parsetree.UserDefinedFunction.execute(UserDefinedFunction.java:130)
        at net.sourceforge.kolmafia.textui.Interpreter.executeScope(Interpreter.java:322)
        at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:249)
        at net.sourceforge.kolmafia.textui.Interpreter.execute(Interpreter.java:242)
        at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:112)
        at net.sourceforge.kolmafia.KoLmafiaASH.getClientHTML(KoLmafiaASH.java:95)
        at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:1587)
        at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:90)
        at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:507)
        at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:148)
        at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:125)

p.s. I like the comments in RelayRequest.

edit:
evidently it has something to do with a casino.ash that I don't remember writing. It looks like
Code:
void main() {
	buffer results;
	results.append(visit_url());
	results.write();
}
 
Last edited:

Veracity

Developer
Staff member
I've never seen this.

I took a clover to the Lemon Party Slots twice yesterday. No problem.
I took a clover to the Lemon Party Slots once today. No problem.

Same as it ever was.
 

xKiv

Active member
judging from the stack trace (KoLmafiaASH.getClientHTML, ... Interpreter.execute, ... UserDefinedFunction.execute, ... RuntimeLibrary.visit_url), you are using a relay script that does something wrong.
 

heeheehee

Developer
Staff member
Huh. I evidently do have a relay script.

Code:
void main() {
	buffer results;
	results.append(visit_url());
	results.write();
}

What's done wrong?
 

xKiv

Active member
Not sure. The code looks to me like this.contentType (which is my guesstimate to what's null there, since this was not null when "this.responseCode = 200;" happened just a few lines before) should be initialized (since "this" is basically == KoLmafiaASH.relayRequest and that had its .contentType already initialized), unless you are clicking too fast and unluckily and a concurent access happens an ... something?
KoLmafiaASH.relayRequest (which is static) seems to only be set once (when KoLmafiaASH is first class-loaded) and contentType is set to null during that initialization only (everything else that sets it sets it to a non-null string) ...

Did you run any ASH scripting before approaching the lemon slot (in the same session)?
 
Top