Skip to content

Commit 8fec2e5

Browse files
committed
Check not null when getting "access_token" from OAuth flo
URLDecoder.decode requires a non-null string, which we aren't checking before calling the method, so we are producing a NullPointerException when the OAuth flow is denied.
1 parent 9270686 commit 8fec2e5

File tree

1 file changed

+1
-1
lines changed
  • gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/oauth

1 file changed

+1
-1
lines changed

gravatar-quickeditor/src/main/java/com/gravatar/quickeditor/ui/oauth/OAuthPage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ internal fun OAuthPage(
7777
split.first() to split.last()
7878
}
7979
?.get("access_token")
80-
.let { URLDecoder.decode(it, "UTF-8") }
80+
?.let { URLDecoder.decode(it, "UTF-8") }
8181

8282
if (token != null) {
8383
viewModel.tokenReceived(email, token)

0 commit comments

Comments
 (0)