Possible NPE bug fix when API connection fails.