Bug 1550185 - Ensure GeckoView CrashHandler.getRootException() does not return null r=snorp
☠☠ backed out by f9c6e9cd8754 ☠ ☠
authorRandall E. Barker <rbarker@mozilla.com>
Wed, 08 May 2019 21:23:13 +0000
changeset 531940 f883d868ce316ef506df5dd52cd0b9697c63760d
parent 531939 d8c72aea4006e2797425d8c0075025f2ee651410
child 531941 073a5c5c22621d3b22b6248135e1be1bf49c9c19
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1550185
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1550185 - Ensure GeckoView CrashHandler.getRootException() does not return null r=snorp Differential Revision: https://phabricator.services.mozilla.com/D30422
mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/CrashHandler.java
@@ -51,20 +51,22 @@ public class CrashHandler implements Thr
     /**
      * Get the root exception from the 'cause' chain of an exception.
      *
      * @param exc An exception
      * @return The root exception
      */
     public static Throwable getRootException(final Throwable exc) {
         Throwable cause;
+        Throwable result = exc;
         for (cause = exc; cause != null; cause = cause.getCause()) {
+          result = cause;
         }
 
-        return cause;
+        return result;
     }
 
     /**
      * Get the standard stack trace string of an exception.
      *
      * @param exc An exception
      * @return The exception stack trace.
      */