Jump to content

TopModsPanel not checking for bad json returns


CarlZalph
  • Fixed

The variable 'result' in my case got returned 500 in json form, the same as an http 500 internal server error.

I suspect it's a fallback so things don't melt elsewhere, but this function doesn't check for only having a number value and expects a json table.

 

Relevant lines leading up to and including the stack trace:

Spoiler

[03:22:02]: [200] Account Communication Success (6)
[03:22:02]: Received (KU_bbC_qbDn) from TokenPurpose
[03:22:02]: [Steam] Auth Session Ticket requested...
[03:22:02]: loaded inventory_cache
[03:22:02]: [Steam] Got Auth Session Ticket
[03:22:03]: loaded inventory_cache
[03:22:04]: SimLuaProxy::QueryServer()
[03:22:05]: QueryStats: { "req":"modrank", "field":"Session.Loads.Mods.list", "fieldop":"unwind", "linkpref":"external", "limit": 20}
[03:22:05]: Frontend-Unloading mod 'all'.	
[03:22:06]: [string "scripts/widgets/topmodspanel.lua"]:162: attempt to index local 'jsonresult' (a number value)
LUA ERROR stack traceback:
scripts/widgets/topmodspanel.lua:162 in (method) OnStatsQueried (Lua) <148-182>
   self =
      featuredbuttonunderline = Image - images/ui.xml:line_horizontal_white.tex
      featuredbutton = BUTTON
      callbacks = table: 14A51730
      morebutton = More Mods
      modlinks = table: 14A53440
      current_speed = 0
      inst = 100590 -  (valid:true)
      focus = false
      default_focus = BUTTON
      next_in_tab_order = BUTTON
      children = table: 29676580
      topmodsgreybg = Image - images/frontend.xml:submenu_greybox.tex
      focus_flow_args = table: 14A51A28
      focus_target = false
      parent = detail_frame
      started = false
      topmods_panel = topmods
      shown = false
      title = Text - Top Mods
      can_fade_alpha = true
      enabled = true
      topmodsbg = Image - images/fepanels.xml:panel_topmods.tex
      name = ModsTab
      mods_tab = ModsTab
      focus_flow = table: 14A51A00
      featuredtitle = Text - Featured Mod
      featuredtitleunderline = Image - images/ui.xml:line_horizontal_white.tex
      servercreationscreen = ServerCreationScreen
   result = 500

   isSuccessful = true
   resultCode = 200
   status = true
   jsonresult = 500
   randomPicks = table: 14A50E98
   i = 1
scripts/widgets/topmodspanel.lua:80 in () ? (Lua) <80-80>
   result = 500

   isSuccessful = true
   resultCode = 200

[03:22:06]: [string "scripts/widgets/topmodspanel.lua"]:162: attempt to index local 'jsonresult' (a number value)
LUA ERROR stack traceback:
    scripts/widgets/topmodspanel.lua:162 in (method) OnStatsQueried (Lua) <148-182>
    scripts/widgets/topmodspanel.lua:80 in () ? (Lua) <80-80>

 


Steps to Reproduce
Experience an http 500 from the topmodspanel query and see the game try to use it since it is a valid http 200 response and it considers it successful even when it isn't.



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...