Bug - Fixed Error when repricing mall store items

antimarty

Member
When I reprice something in my store from the relay browser, using the "update" link in the native game's manage store screen, I get an "Unexpected error, debug log printed." The price updates OK, though.

Code:
Unexpected error, debug log printed.
class java.lang.NullPointerException: null
java.lang.NullPointerException
	at net.sourceforge.kolmafia.session.StoreManager.updateSomePrices(StoreManager.java:1142)
	at net.sourceforge.kolmafia.request.ManageStoreRequest.parseResponse(ManageStoreRequest.java:381)
	at net.sourceforge.kolmafia.session.ResponseTextParser.externalUpdate(ResponseTextParser.java:309)
	at net.sourceforge.kolmafia.session.ResponseTextParser.externalUpdate(ResponseTextParser.java:262)
	at net.sourceforge.kolmafia.request.GenericRequest.processResults(GenericRequest.java:2855)
	at net.sourceforge.kolmafia.request.PasswordHashRequest.processResults(PasswordHashRequest.java:54)
	at net.sourceforge.kolmafia.request.GenericRequest.processResponse(GenericRequest.java:2583)
	at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:2461)
	at net.sourceforge.kolmafia.request.GenericRequest.retrieveServerReply(GenericRequest.java:2057)
	at net.sourceforge.kolmafia.request.GenericRequest.externalExecute(GenericRequest.java:1617)
	at net.sourceforge.kolmafia.request.GenericRequest.execute(GenericRequest.java:1600)
	at net.sourceforge.kolmafia.request.GenericRequest.run(GenericRequest.java:1320)
	at net.sourceforge.kolmafia.request.RelayRequest.run(RelayRequest.java:3165)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:286)
	at net.sourceforge.kolmafia.RequestThread.postRequest(RequestThread.java:249)
	at net.sourceforge.kolmafia.webui.RelayAgent.readServerResponse(RelayAgent.java:576)
	at net.sourceforge.kolmafia.webui.RelayAgent.performRelay(RelayAgent.java:164)
	at net.sourceforge.kolmafia.webui.RelayAgent.run(RelayAgent.java:137)
 

Veracity

Developer
Staff member
The issue is that if you are visiting your store from the Relay Browser for the first time, we have not built our internal "soldItems" list. We could easily do so from looking at the same page you are looking at in the Relay Browser. I am not sure why we don't.

The easy solution would be to simply punt at the point of failure in your stack trace - actually check for a -1 index - and that is probably reasonable, anyway, but I want to see if we can update from the Relay Browser, rather than just the GUI.
 

Veracity

Developer
Staff member
Revision 17607 does those things: loads up shop inventory when you visit Manage Your Store in the Relay Browser, and is defensive about finding the item when parsing the JSON result of changing a price.
 
Top