Skip to content

Commit

Permalink
Handle null response object
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasberglund committed Aug 21, 2024
1 parent f6e6ad2 commit 0b044c7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ class SimpleMullvadHttpClient(context: Context) {
"Unable to verify account due to invalid account or connectivity issues."

private val onErrorResponse = { error: VolleyError ->
Logger.e("Response returned error status code: ${error.networkResponse.statusCode}")
if (error.networkResponse != null) {
Logger.e("Response returned error message: ${error.message}, status code: ${error.networkResponse.statusCode}")
} else {
Logger.e("Response returned error: ${error.message}")
}
}
}
}

0 comments on commit 0b044c7

Please sign in to comment.