Bug - Fixed r10207 error on loading character status

Magus_Prime

Well-known member
When I logged into r10207 I received the following error in the gCLI:

Code:
Loading character status...
api.php?what=status parse error: JSONObject["effects"] is not a JSONObject.
{"basemoxie":"113","hp":"404","turnsthisrun":2758,"mcd":0,"stickers":[0,0,0],"moxie":120,"drunk":"0","equipment":{"acc2":"2618","acc1":"3033","acc3":"2033","fakehands":0,"pants":"2032","weapon":"2559","offhand":"1902","hat":"2337"},"mysticality":115,"turnsplayed":"2758","freedralph":0,"title":"13","recalledskills":0,"daysthisrun":702,"famlevel":20,"level":"13","full":"0","hardcore":"0","casual":"0","name":"Witcheepoo","meat":"9528","path":"0","rawmysticality":"11762","basemuscle":"150","rollover":null,"rawmuscle":"22706","maxmp":155,"ascensions":"0","mp":"167","familiarexp":400,"flag_config":{"dontscroll":0,"autodiscard":0,"unfamequip":0,"invimages":0,"nodevdebug":0,"invadvancedsort":0,"alwaystag":0,"showhandedness":0,"swapfam":0,"anchorshelf":0,"quickskills":0,"clanlogins":0,"showoutfit":0,"fullnesscounter":0,"hidejacko":0,"wowbar":0,"autoattack":0,"powersort":0,"multisume":0,"compactchar":0,"lazyinventory":0,"sellstuffugly":0,"nocalendar":0,"threecolinv":0,"topmenu":0,"profanity":0,"hprestorers":0,"questtracker":0,"acclinks":0,"noquestnudge":0,"invclose":0,"oneclickcraft":0},"basemysticality":"108","roninleft":"0","rawmoxie":"12968","muscle":173,"class":"1","effects":[],"playerid":"2080263","familiarpic":"smilerat","lastadv":{"id":"126","container":"bigisland.php?place=nunnery","link":"adventure.php?snarfblat=126","name":"The Themthar Hills"},"familiar":"142","sign":"None","pwd":"d43f9375a6c9442146cb26d884fbd93a","pathname":"","maxhp":304,"adventures":"192"}
Retrieving character data...

This is on a soft-core non-pathed character that has never ascended.
 

fronobulax

Developer
Staff member
FWIW I cannot reproduce with any character including a never-ascended character that has been around for many years. Thus, not sure what the trigger might be...
 

matt.chugg

Moderator
FWIW I cannot reproduce with any character including a never-ascended character that has been around for many years. Thus, not sure what the trigger might be...

I think when the character has no active effects, the JSON returned in apirequest?what=status, doesn't contain the key "effects" so in CharPaneRequest.parseStatus, this: JSONObject effects = JSON.getJSONObject( "effects" ); throws this: throw new JSONException("JSONObject[" + quote(key) + "] is not a JSONObject.") in JSONObject

EDIT: reproduced by logging in with a character with no effects.

I think this may have started at 10205 when this was implimented http://kolmafia.us/showthread.php?8...l-CharPane-parser-rather-than-the-CharSheet-p
 

Veracity

Developer
Staff member
It does contain the key "effects", but the value is an empty JSON Array, not a JSON Object.

Revision 10208
 
Top