bug 1262812 - use fallback strings in CrashSubmit.jsm so submitting crashes from about:crashes works on Android. r?mconley draft
authorTed Mielczarek <ted@mielczarek.org>
Wed, 24 May 2017 11:07:41 -0400
changeset 583753 2bfc3d83ed813421cb0c66589920442310f2cac4
parent 581334 c800b6dfca673f8cb0f3cf41e4f495755d04bbb3
child 630184 7af74809d18f83b20c861942ab5bdd27e8d5190e
push id60527
push userbmo:ted@mielczarek.org
push dateWed, 24 May 2017 15:38:31 +0000
reviewersmconley
bugs1262812
milestone55.0a1
bug 1262812 - use fallback strings in CrashSubmit.jsm so submitting crashes from about:crashes works on Android. r?mconley MozReview-Commit-ID: 3aw17aFysu4
toolkit/crashreporter/CrashSubmit.jsm
--- a/toolkit/crashreporter/CrashSubmit.jsm
+++ b/toolkit/crashreporter/CrashSubmit.jsm
@@ -52,18 +52,23 @@ function getL10nStrings() {
     path = path.parent;
     path = path.parent;
     path.append("MacOS");
     path.append("crashreporter.app");
     path.append("Contents");
     path.append("Resources");
     path.append("crashreporter.ini");
     if (!path.exists()) {
-      // very bad, but I don't know how to recover
-      return null;
+      // This happens on Android where everything is in an APK.
+      // Android users can't see the contents of the submitted files
+      // anyway, so just hardcode some fallback strings.
+      return {
+        "crashid": "Crash ID: %s",
+        "reporturl": "You can view details of this crash at %s"
+      };
     }
   }
   let crstrings = parseINIStrings(path);
   let strings = {
     "crashid": crstrings.CrashID,
     "reporturl": crstrings.CrashDetailsURL
   };