You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[google-auth-library-java] NullPointerException when APPDATA environment variable is unset on Windows in GoogleAuthUtils.getWellKnownCredentialsFile #12565
In GoogleAuthUtils.getWellKnownCredentialsFile, when the OS is detected as Windows and the CLOUDSDK_CONFIG environment variable is not set, the code attempts to resolve the gcloud configuration directory using the APPDATA environment variable. If the APPDATA environment variable is missing, provider.getEnv("APPDATA") returns null.
Passing null to the new File(String) constructor instantly throws a raw NullPointerException. This causes the library to crash with an unhelpful stack overflow or server runtime crash, instead of failing gracefully with a FileNotFoundException or IOException.
In GoogleAuthUtils.getWellKnownCredentialsFile, when the OS is detected as Windows and the CLOUDSDK_CONFIG environment variable is not set, the code attempts to resolve the gcloud configuration directory using the APPDATA environment variable. If the APPDATA environment variable is missing, provider.getEnv("APPDATA") returns null.
Passing null to the new File(String) constructor instantly throws a raw NullPointerException. This causes the library to crash with an unhelpful stack overflow or server runtime crash, instead of failing gracefully with a FileNotFoundException or IOException.