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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user