[gnome-shell] autorunManager: Avoid access to non-existent array element



commit 2d11b5cea0d218e4ec88450e2dcf5f82df75f383
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Sep 17 11:37:52 2017 +0200

    autorunManager: Avoid access to non-existent array element
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787907

 js/ui/components/autorunManager.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js
index de0fda7..ac09ae8 100644
--- a/js/ui/components/autorunManager.js
+++ b/js/ui/components/autorunManager.js
@@ -255,7 +255,11 @@ var AutorunDispatcher = new Lang.Class({
         if (!shouldAutorunMount(mount))
             return;
 
-        let setting = this._getAutorunSettingForType(contentTypes[0]);
+        let setting;
+        if (contentTypes.length > 0)
+            setting = this._getAutorunSettingForType(contentTypes[0]);
+        else
+            setting = AutorunSetting.ASK;
 
         // check at the settings for the first content type
         // to see whether we should ask


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