mirror of
https://github.com/abraunegg/onedrive
synced 2024-05-18 21:56:43 +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);
|
assert(item.type == ItemType.dir);
|
||||||
if (exists(path)) {
|
if (exists(path)) {
|
||||||
if (!isDir(path)) {
|
// Fix https://github.com/abraunegg/onedrive/issues/1915
|
||||||
log.vlog("The item was a directory but now it is a file");
|
try {
|
||||||
uploadDeleteItem(item, path);
|
if (!isDir(path)) {
|
||||||
uploadNewFile(path);
|
log.vlog("The item was a directory but now it is a file");
|
||||||
} else {
|
uploadDeleteItem(item, path);
|
||||||
log.vlog("The directory has not changed");
|
uploadNewFile(path);
|
||||||
// loop through the children
|
} else {
|
||||||
foreach (Item child; itemdb.selectChildren(item.driveId, item.id)) {
|
log.vlog("The directory has not changed");
|
||||||
uploadDifferences(child);
|
// 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 {
|
} else {
|
||||||
// Directory does not exist locally
|
// Directory does not exist locally
|
||||||
|
|
Loading…
Reference in a new issue