From 0766e330ebce2c8e17624f46b1d34978f5916df7 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 3 Sep 2014 14:14:37 -0700 Subject: [PATCH] Bug 1061970: Check if JS variable 'this._statements' is defined before using it (and use 'for...of'), in CPS2_destroy(). r=adw --- toolkit/components/contentprefs/ContentPrefService2.jsm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toolkit/components/contentprefs/ContentPrefService2.jsm b/toolkit/components/contentprefs/ContentPrefService2.jsm index 68c416c4994..f6c3866fdcb 100644 --- a/toolkit/components/contentprefs/ContentPrefService2.jsm +++ b/toolkit/components/contentprefs/ContentPrefService2.jsm @@ -654,8 +654,10 @@ ContentPrefService2.prototype = { }, destroy: function CPS2_destroy() { - for each (let stmt in this._statements) { - stmt.finalize(); + if (this._statements) { + for (let stmt of this._statements) { + stmt.finalize(); + } } },