From 21b6e1aabc5d77743571067761632b10b80d4148 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 15 Jun 2016 11:26:03 -0400 Subject: [PATCH] Prevent an invalid drive from being auto-selected (#484) Currently we have logic in the drive selector dialog to prevent invalid drives (too small, locked, etc) from being selected, however we are not protecting auto-selection from these invalid devices. Signed-off-by: Juan Cruz Viotti --- lib/gui/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/gui/app.js b/lib/gui/app.js index e478a5df..e7bda8bf 100644 --- a/lib/gui/app.js +++ b/lib/gui/app.js @@ -165,6 +165,10 @@ app.controller('AppController', function( if (drives.length === 1 && self.selection.hasImage()) { const drive = _.first(drives); + if (!self.selection.isDriveValid(drive)) { + return; + } + // Do not autoselect the same drive over and over again // and fill the logs unnecessary. // `angular.equals` is used instead of `_.isEqual` to