[extensions-web] dbus: Fix site when there's no plugin installed



commit 62475b26c2d6d03167c75b10659bda71806b7a01
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Feb 17 01:05:18 2012 -0500

    dbus: Fix site when there's no plugin installed
    
    I thought that getting an attribute on a non-existent plugin object
    would error out, but nope. Fall back to the dummy on a false-y value
    instead.

 sweettooth/static/js/dbus.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/static/js/dbus.js b/sweettooth/static/js/dbus.js
index 8d1756e..0a26c90 100644
--- a/sweettooth/static/js/dbus.js
+++ b/sweettooth/static/js/dbus.js
@@ -45,7 +45,7 @@ define({
                 return;
             }
 
-            var apiVersion = "dummy";
+            var apiVersion = undefined;
 
             try {
                 if (window.SweetTooth) {
@@ -53,6 +53,9 @@ define({
                 }
             } catch (e) { }
 
+            if (!apiVersion)
+                apiVersion = 'dummy';
+
             var scriptname = './versions/' + apiVersion + '/main';
             // requirejs caches response.
             req([scriptname], function(module) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]