Fix crash when user not connected and try to access resource