Bug 1550185 - Ensure GeckoView CrashHandler.getRootException() does not return null r=snorp
authorRandall E. Barker <rbarker@mozilla.com>
Wed, 08 May 2019 23:49:04 +0000
changeset 531972 176eced1154bca5f78b54505aa0b8a7bbabeacb6
parent 531971 a0c91ab4d3477cdb041c00dee13354cafafb83fd
child 531973 c8ada1038c844c5c218b592ea26a09d8f0d4cb83
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.
      */