mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-03 06:23:16 +02:00
Fix crash when trying to sync broken symbolic link (#1917)
* Check the response for directory checks as to if it generates a file exception error
This commit is contained in:
parent
5d320505c7
commit
29b0ef0b98
25
src/sync.d
25
src/sync.d
|
@ -3469,16 +3469,23 @@ final class SyncEngine
|
|||
{
|
||||
assert(item.type == ItemType.dir);
|
||||
if (exists(path)) {
|
||||
if (!isDir(path)) {
|
||||
log.vlog("The item was a directory but now it is a file");
|
||||
uploadDeleteItem(item, path);
|
||||
uploadNewFile(path);
|
||||
} else {
|
||||
log.vlog("The directory has not changed");
|
||||
// loop through the children
|
||||
foreach (Item child; itemdb.selectChildren(item.driveId, item.id)) {
|
||||
uploadDifferences(child);
|
||||
// Fix https://github.com/abraunegg/onedrive/issues/1915
|
||||
try {
|
||||
if (!isDir(path)) {
|
||||
log.vlog("The item was a directory but now it is a file");
|
||||
uploadDeleteItem(item, path);
|
||||
uploadNewFile(path);
|
||||
} else {
|
||||
log.vlog("The directory has not changed");
|
||||
// loop through the children
|
||||
foreach (Item child; itemdb.selectChildren(item.driveId, item.id)) {
|
||||
uploadDifferences(child);
|
||||
}
|
||||
}
|
||||
} catch (FileException e) {
|
||||
// display the error message
|
||||
displayFileSystemErrorMessage(e.msg, getFunctionName!({}));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Directory does not exist locally
|
||||
|
|
Loading…
Reference in a new issue