Newgrounds icon indicating copy to clipboard operation
Newgrounds copied to clipboard

Wrong null checks in Call.onHttpError cause an exception

Open TheMysticSword opened this issue 1 year ago • 2 comments

https://github.com/Geokureli/Newgrounds/blob/65fa7ca24dce2f8eb972b9b88b47e3ebe7023430/lib/Source/io/newgrounds/Call.hx#LL262C7-L262C24 If an http call fails, this part will cause the entire app to fail. The easiest way to make this happen is to turn off internet connection and create an NG.core

TheMysticSword avatar Jun 10 '23 18:06 TheMysticSword

can you be more specific about what you mean by "will cause the entire app to fail"

Geokureli avatar Jun 10 '23 22:06 Geokureli

It just crashes. On Neko, this is the error:

io/newgrounds/Call.hx:260: [Newgrounds API] :: Error: std@host_resolve
Called from ? line 1
Called from ApplicationMain.hx line 25
Called from ApplicationMain.hx line 130
Called from lime/app/Application.hx line 150
Called from lime/_internal/backend/native/NativeApplication.hx line 146
Called from a C function
Called from lime/_internal/backend/native/NativeApplication.hx line 173
Called from lime/_internal/backend/native/NativeApplication.hx line 585
Called from io/newgrounds/utils/AsyncHttp.hx line 212
Called from io/newgrounds/utils/AsyncHttp.hx line 164
Called from io/newgrounds/utils/AsyncHttp.hx line 158
Called from io/newgrounds/Call.hx line 266
Uncaught exception - Invalid field access : dispatch

and on Android, it only traces

06-11 17:02:01.732 10422 10635 I trace   : io/newgrounds/Call.hx:260: [Newgrounds API] :: Error: newgrounds.io:No address associated with hostname

before crashing and quitting out of the app (and, yes, i did manually add mobile in the list of supported targets, since it seems to be working completely fine)

TheMysticSword avatar Jun 11 '23 12:06 TheMysticSword