From 17f19d563bae46c6d78a9380301e6d2b455ba566 Mon Sep 17 00:00:00 2001 From: Yuuki Wesp Date: Sat, 12 Dec 2015 19:59:34 +0300 Subject: [PATCH] Fix bugs in the crash unprepared device --- source/Cosmos.Deploy.USB/MainWindow.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Cosmos.Deploy.USB/MainWindow.xaml.cs b/source/Cosmos.Deploy.USB/MainWindow.xaml.cs index e6476583b..b3ebb8847 100644 --- a/source/Cosmos.Deploy.USB/MainWindow.xaml.cs +++ b/source/Cosmos.Deploy.USB/MainWindow.xaml.cs @@ -38,7 +38,10 @@ namespace Cosmos.Deploy.USB { var xDrives = DriveInfo.GetDrives().Where(q => q.DriveType == DriveType.Removable).ToArray(); lboxTarget.Items.Clear(); - foreach (var x in xDrives) { + foreach (var x in xDrives) + { + if (!x.IsReady) + continue; decimal xSize = x.TotalSize / (1000 * 1000 * 1000); lboxTarget.Items.Add(x.Name + " " + xSize.ToString("0.0") + " GiB " + x.DriveFormat + " [" + x.VolumeLabel + "]"); }