From 03660f45b14a9d90d6971319f10dc0efb498d6bf Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 12 May 2011 19:39:22 +0200 Subject: [PATCH] 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 file changed, 6 insertions(+) diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js index a5882d3f..bda87066 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);