Bug 1244225 - Do not access allocation recording settings when the memory component isn't attached. r=fitzgen
authorJordan Santell <jsantell@mozilla.com>
Mon, 08 Feb 2016 14:25:00 +0100
changeset 329846 5506056498b00367f35a899e04e178b686ddd4ab
parent 329845 802e3c169db8af28f8a9d30115e05d120f1f544b
child 329847 1e3b60dd103a84f3fb895de0498f11fd494384c0
push id10617
push userdtownsend@mozilla.com
push dateTue, 09 Feb 2016 16:30:19 +0000
reviewersfitzgen
bugs1244225
milestone47.0a1
Bug 1244225 - Do not access allocation recording settings when the memory component isn't attached. r=fitzgen
devtools/server/performance/recorder.js
--- a/devtools/server/performance/recorder.js
+++ b/devtools/server/performance/recorder.js
@@ -462,17 +462,23 @@ const PerformanceRecorder = exports.Perf
   /**
    * Returns the configurations set on underlying components, used in tests.
    * Returns an object with `probability`, `maxLogLength` for allocations, and
    * `features`, `threadFilters`, `entries` and `interval` for profiler.
    *
    * @return {object}
    */
   getConfiguration: function () {
-    return extend({}, this._memory.getAllocationsSettings(), this._profiler.getStartOptions());
+    let allocationSettings = Object.create(null);
+
+    if (this._memory.getState() === "attached") {
+      allocationSettings = this._memory.getAllocationsSettings();
+    }
+
+    return extend({}, allocationSettings, this._profiler.getStartOptions());
   },
 
   toString: () => "[object PerformanceRecorder]"
 });
 
 /**
  * Creates an object of configurations based off of preferences for a PerformanceRecording.
  */