Fix for crash when retrieving last session error without active session

Fix for crash when retrieving last session error without active session. This crash would occur if a user for example tries to fetch data although the connection couldn't be established and he forgets to check the connection status (e.g. client.connected).