Skip to content
Snippets Groups Projects
Commit 9b82a505 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Handle empty folders inside the processing location.

parent c486a1da
No related branches found
No related tags found
No related merge requests found
......@@ -619,9 +619,22 @@ namespace AutoTx
var queued = new DirectoryInfo(processingDir).GetDirectories();
if (queued.Length == 0)
return;
var subdirs = queued[0].GetDirectories();
if (subdirs.Length == 0) {
writeLog("WARNING: empty processing directory found: " + queued[0].Name);
try {
queued[0].Delete();
writeLogDebug("Removed empty directory: " + queued[0].Name);
}
catch (Exception ex) {
writeLog("Error deleting directory: " + queued[0].Name + " - " + ex.Message);
return;
}
return;
}
try {
_status.CurrentTransferSrc = queued[0].GetDirectories()[0].FullName;
_status.CurrentTransferSrc = subdirs[0].FullName;
_status.CurrentTransferSize = GetDirectorySize(_status.CurrentTransferSrc);
}
catch (Exception ex) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment