Is there a way to check for an internet connection before doing things such as mystery gift. When i try to access such features with no internet connection i get an error
Ideally i'd like for it to just say something along the lines of an internet connection is required, but at the moment it just crashes
Exception: NoMethodError
Message: undefined method `size' for nil:NilClass
Sockets:368:in `connect'
Sockets:510:in `initialize'
Sockets:586:in `new'
Sockets:586:in `pbHttpRequest'
Sockets:562:in `pbPostData'
PokemonLoad * Edited:379:in `pbStartLoadScreen'
DebugIntro:6:in `main'
Main:37:in `mainFunctionDebug'
Main:15:in `mainFunction'
Main:15:in `pbCriticalCode'
Ideally i'd like for it to just say something along the lines of an internet connection is required, but at the moment it just crashes