Fix crashes when unzipping repo on first sync from remote

This commit is contained in:
Silvano Cerza 2025-04-18 18:05:30 +02:00
parent b6be53ca16
commit 56bd6dee4c

View file

@ -206,6 +206,13 @@ export default class SyncManager {
const targetPath = const targetPath =
pathParts.length > 1 ? pathParts.slice(1).join("/") : entry.filename; pathParts.length > 1 ? pathParts.slice(1).join("/") : entry.filename;
if (targetPath === "") {
// Must be the root folder, skip it.
// This is really important as that would lead us to try and
// create the folder "/" and crash Obsidian
return;
}
if ( if (
this.settings.syncConfigDir && this.settings.syncConfigDir &&
targetPath.startsWith(this.vault.configDir) && targetPath.startsWith(this.vault.configDir) &&