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 31da574 commit bbb76b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import net.mullvad.mullvadvpn.test.common.constant.LOGIN_FAILURE_TIMEOUT
import net.mullvad.mullvadvpn.test.common.extension.clickAgreeOnPrivacyDisclaimer
import net.mullvad.mullvadvpn.test.common.extension.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove
import net.mullvad.mullvadvpn.test.common.extension.findObjectWithTimeout
import net.mullvad.mullvadvpn.test.e2e.annotations.HighlyRateLimited
import net.mullvad.mullvadvpn.test.e2e.misc.AccountTestRule
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.RegisterExtension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,14 @@ 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 bbb76b5

Please sign in to comment.