jenkins-bot has submitted this change and it was merged.

Change subject: Fix possible NPE when showing retryable error.
......................................................................


Fix possible NPE when showing retryable error.

https://rink.hockeyapp.net/manage/apps/226650/app_versions/11/crash_reasons/110303802

Change-Id: I28a8cc7ae0ac510a0175f18848e8bc30b0f760bd
---
M app/src/main/java/org/wikipedia/util/ThrowableUtil.java
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Sniedzielski: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/app/src/main/java/org/wikipedia/util/ThrowableUtil.java 
b/app/src/main/java/org/wikipedia/util/ThrowableUtil.java
index 66f3d1d..ec28683 100644
--- a/app/src/main/java/org/wikipedia/util/ThrowableUtil.java
+++ b/app/src/main/java/org/wikipedia/util/ThrowableUtil.java
@@ -6,6 +6,8 @@
 import org.json.JSONException;
 import android.content.Context;
 import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
 import javax.net.ssl.SSLException;
 import java.net.UnknownHostException;
 import java.util.concurrent.TimeoutException;
@@ -65,7 +67,7 @@
     }
 
     public static boolean isRetryable(@NonNull ThrowableUtil.AppError e) {
-        return !e.getDetail().contains("404");
+        return !(e.getDetail() != null && e.getDetail().contains("404"));
     }
 
     private static boolean isNetworkError(@NonNull Throwable e) {
@@ -106,13 +108,15 @@
     public static class AppError {
         private String error;
         private String detail;
-        public AppError(String error, String detail) {
+        public AppError(@NonNull String error, @Nullable String detail) {
             this.error = error;
             this.detail = detail;
         }
+        @NonNull
         public String getError() {
             return error;
         }
+        @Nullable
         public String getDetail() {
             return detail;
         }

-- 
To view, visit https://gerrit.wikimedia.org/r/268723
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I28a8cc7ae0ac510a0175f18848e8bc30b0f760bd
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
Gerrit-Reviewer: BearND <[email protected]>
Gerrit-Reviewer: Brion VIBBER <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to