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.
This commit is contained in:
Giovanni Campagna
2011-05-12 19:39:22 +02:00
parent 1a00ee38fe
commit 03660f45b1
+6
View File
@@ -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);