Skip to content

Commit

Permalink
Only scan drives that are ready to prevent a device not ready errpr
Browse files Browse the repository at this point in the history
My grandpa's CD drive was not ready and caused the error
  • Loading branch information
sander1095 committed Apr 5, 2021
1 parent f6fd1cd commit 604b2d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DiasForGrandpa.WPF/ViewModels/OrganizerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void Validate()
// our code would bug out and accidently delete important files....

if (!Directory.Exists(App.Settings.DiaFolderInputPath) ||
!DriveInfo.GetDrives().Any(x => x.VolumeLabel == App.Settings.DiaVolumeName) ||
!DriveInfo.GetDrives().Where(x => x.IsReady).Any(x => x.VolumeLabel == App.Settings.DiaVolumeName) ||
Directory.GetFiles(App.Settings.DiaFolderInputPath).Length == 0)
{
ErrorDialog.ShowError(
Expand Down

0 comments on commit 604b2d2

Please sign in to comment.