diff options
author | awerghcpc <6479040+awerghcpc@users.noreply.github.com> | 2022-03-20 05:49:52 +0300 |
---|---|---|
committer | awerghcpc <6479040+awerghcpc@users.noreply.github.com> | 2022-03-20 05:49:52 +0300 |
commit | ed5d2c23c6a77a1cd502c3b843dbfd4a62d30442 (patch) | |
tree | 0dd70da46b99720ee9455052fc3e9fac2d41d369 | |
parent | 21da623d3f3cd6ab28843ecd7d465c99cd610040 (diff) |
Check that the vhd exists and log a warning if it does not.
-rw-r--r-- | Duplicati/Library/Snapshots/HyperVUtility.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Duplicati/Library/Snapshots/HyperVUtility.cs b/Duplicati/Library/Snapshots/HyperVUtility.cs index 243ffc76b..423b24911 100644 --- a/Duplicati/Library/Snapshots/HyperVUtility.cs +++ b/Duplicati/Library/Snapshots/HyperVUtility.cs @@ -302,7 +302,16 @@ namespace Duplicati.Library.Snapshots select ((string[])systemBaseObj["Connection"])[0]).ToList();
foreach (var vhd in tempvhd)
- result.Add(vhd);
+ {
+ if (File.Exists(vhd))
+ {
+ result.Add(vhd);
+ }
+ else
+ {
+ Logging.Log.WriteWarningMessage(LOGTAG, "HyperVInvalidVhd", null, "Invalid VHD file detected, file does not exist: {0}", vhd);
+ }
+ }
}
}
|