[gnome-shell/hotplug: 14/14] autorun-manager: Fix exception in _emitCallback()



commit 19e66d94514bd2c43320a5ac2e75a8873ccb9ce7
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Jun 28 00:02:11 2011 +0200

    autorun-manager: Fix exception in _emitCallback()
    
    If the contentTypes parameter is undefined, we cannot push a
    default type into it. Split the condition and assign an empty
    errors to contentTypes if it is not defined before pushing the
    default type if the contentTypes array is empty.

 js/ui/autorunManager.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/autorunManager.js b/js/ui/autorunManager.js
index 6bf1d39..3dd5398 100644
--- a/js/ui/autorunManager.js
+++ b/js/ui/autorunManager.js
@@ -114,7 +114,10 @@ ContentTypeDiscoverer.prototype = {
     },
 
     _emitCallback: function(mount, contentTypes) {
-        if (!contentTypes || !contentTypes.length)
+        if (!contentTypes)
+            contentTypes = [];
+
+        if (!contentTypes.length)
             contentTypes.push('inode/directory');
 
         // we're not interested in win32 software content types here



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