[gnome-shell-extensions] drive-menu: do nothing if the drive is has no volume



commit 03660f45b14a9d90d6971319f10dc0efb498d6bf
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu May 12 19:39:22 2011 +0200

    drive-menu: do nothing if the drive is has no volume
    
    If the drive is not partitioned, or the volume has not appeared yet,
    return early from activate, to avoid an exception.

 extensions/drive-menu/extension.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js
index a5882d3..bda8706 100644
--- a/extensions/drive-menu/extension.js
+++ b/extensions/drive-menu/extension.js
@@ -102,6 +102,12 @@ DriveMenuItem.prototype = {
     },
 
     activate: function(event) {
+	if (!this._primaryVolume) {
+	    // can't do anything
+	    PopupMenu.PopupBaseMenuItem.prototype.activate.call(this, event);
+	    return;
+	}
+
 	let mount = this._primaryVolume.get_mount();
 	if (mount) {
 	    this._launchMount(mount);



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