Fixed crash when connecting to a server that isn't reachable (null checks).