Commit 8d71390a authored by Nicholas Nethercote's avatar Nicholas Nethercote
Browse files

Bug 1269648 - Add missing crash-reporter null checks. r=froydnj.

In two places we fail to check if we successful obtained the crash reporter
before we use it.

--HG--
extra : rebase_source : f757b8320788220b5a4d5242a0264d577d92f15e
parent 3017794b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -50,7 +50,9 @@ TestCrashyOperation(void (*aCrashyOperation)())
#ifdef MOZ_CRASHREPORTER
    nsCOMPtr<nsICrashReporter> crashreporter =
      do_GetService("@mozilla.org/toolkit/crash-reporter;1");
    if (crashreporter) {
      crashreporter->SetEnabled(false);
    }
#endif

    // Child: perform the crashy operation.
+3 −1
Original line number Diff line number Diff line
@@ -463,8 +463,10 @@ static bool SaveMemoryReportNearOOM()
  if (needMemoryReport) {
    nsCOMPtr<nsICrashReporter> cr =
      do_GetService("@mozilla.org/toolkit/crash-reporter;1");
    if (cr) {
      cr->SaveMemoryReport();
    }
  }

  return needMemoryReport;
}