mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-02-28 01:00:17 +08:00
Do not crash when calling on network drives e.g. "\\vmware\shared"
This commit is contained in:
@@ -27,10 +27,17 @@ namespace QuickLook.Plugin.InfoPanel
|
|||||||
{
|
{
|
||||||
totalSpace = totalFreeSpace = 0L;
|
totalSpace = totalFreeSpace = 0L;
|
||||||
|
|
||||||
var root = new DriveInfo(Path.GetPathRoot(path));
|
try
|
||||||
|
{
|
||||||
|
var root = new DriveInfo(Path.GetPathRoot(path));
|
||||||
|
|
||||||
totalSpace = root.TotalSize;
|
totalSpace = root.TotalSize;
|
||||||
totalFreeSpace = root.AvailableFreeSpace;
|
totalFreeSpace = root.AvailableFreeSpace;
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// ignored
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void CountFolder(string root, ref bool stop, out long totalDirs, out long totalFiles,
|
public static void CountFolder(string root, ref bool stop, out long totalDirs, out long totalFiles,
|
||||||
|
|||||||
Reference in New Issue
Block a user