From b4d5a90ea9800c448a5ae167df6e05fbdc3a0ce1 Mon Sep 17 00:00:00 2001 From: Robert Strong Date: Wed, 5 May 2010 15:02:45 -0700 Subject: [PATCH] Bug 562848: Lightweight themes without descriptions display undefined for text. r=dtownsend --- .../mozapps/extensions/LightweightThemeManager.jsm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/toolkit/mozapps/extensions/LightweightThemeManager.jsm b/toolkit/mozapps/extensions/LightweightThemeManager.jsm index 7ff1cc00281..799d1b368c0 100644 --- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm @@ -394,9 +394,17 @@ function AddonWrapper(aTheme, aBeingEnabled) { return false; }); - ["name", "version", "description", "homepageURL", "iconURL"].forEach(function(prop) { - this.__defineGetter__(prop, function() aTheme[prop]); + this.__defineGetter__("name", function() aTheme.name); + this.__defineGetter__("version", function() { + return "version" in aTheme ? aTheme.version : ""; + }); + + ["description", "homepageURL", "iconURL"].forEach(function(prop) { + this.__defineGetter__(prop, function() { + return prop in aTheme ? aTheme[prop] : null; + }); }, this); + this.__defineGetter__("creator", function() aTheme.author); this.__defineGetter__("screenshots", function() [aTheme.previewURL]);