[gnome-shell/hotplug] autorun-manager: Fix exception in _emitCallback()
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/hotplug] autorun-manager: Fix exception in _emitCallback()
- Date: Tue, 28 Jun 2011 13:42:13 +0000 (UTC)
commit 054f2ea590845ddc8627052a56b815e56ac8d899
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]