mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-02-27 01:00:11 +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;
|
||||
|
||||
var root = new DriveInfo(Path.GetPathRoot(path));
|
||||
try
|
||||
{
|
||||
var root = new DriveInfo(Path.GetPathRoot(path));
|
||||
|
||||
totalSpace = root.TotalSize;
|
||||
totalFreeSpace = root.AvailableFreeSpace;
|
||||
totalSpace = root.TotalSize;
|
||||
totalFreeSpace = root.AvailableFreeSpace;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
public static void CountFolder(string root, ref bool stop, out long totalDirs, out long totalFiles,
|
||||
|
||||
Reference in New Issue
Block a user