Author Topic: Crash on Improperly Formatted API Call  (Read 1584 times)

0 Members and 1 Guest are viewing this topic.

TheDefiant604

  • Youngling
  • *
  • Posts: 21
  • Karma: +0/-0
    • View Profile
  • Twitch Name: TheDefiant604
Crash on Improperly Formatted API Call
« on: April 19, 2017, 07:13:06 AM »
Bug: DeepBot crashes on improperly formatted API calls.
Info: DeepBot will crash when accessing an object, as opposed to a key, within the @customjsonapi@ variable, even if the object doesn't exist.
How you produced this bug or came across it: I was adding a test to see if an object existed within a JSON payload in order to print a different message instead of the usual "API Error" when the key was not found.  Basically, I was doing @if@[@customjsonapi@[api.site.com/path,payload.object]||API Error||Doesn't exist.||@customjsonapi@[api.site.com/path,payload.object.key]].  Even though "object" didn't exist within "payload", DeepBot crashed anyway.  When I changed it to check if "payload.object.key" existed, everything worked fine.

Note: I am a chat moderator for a DeepBot user.  I do not have access to the debug output.
Chat Moderator for RandomRambo

TheDefiant604

  • Youngling
  • *
  • Posts: 21
  • Karma: +0/-0
    • View Profile
  • Twitch Name: TheDefiant604
Re: Crash on Improperly Formatted API Call
« Reply #1 on: April 20, 2017, 03:16:17 AM »
I made a mistake in reporting that "payload.object" didn't exist.  It did exist, so I was actually attempting to read an object as a key, thus resulting in a crash.
Chat Moderator for RandomRambo