#1304·PocketHub

When getuser() failed, the app will crash

Author: Android-Login-AnalysisCreated Apr 3, 2025Updated Apr 3, 2025

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.meisolsson.githubsdk.model.User.login()' on a null object reference at com.github.pockethub.android.accounts.LoginActivity.endAuth(LoginActivity.java:78) at com.github.pockethub.android.accounts.LoginActivity.lambda$onUserLoggedIn$1(LoginActivity.java:45)

The reason is when userService.getUser() is null, user.login will crash.