Fix stack overflow creating windows network folders (#2886)

This commit is contained in:
WithoutPants
2022-09-06 11:26:10 +10:00
parent 276f14cdcb
commit 0c513a604d
2 changed files with 2 additions and 2 deletions

View File

@@ -164,7 +164,7 @@ func (i *fileFolderImporter) FindExistingID(ctx context.Context) (*int, error) {
func (i *fileFolderImporter) createFolderHierarchy(ctx context.Context, p string) (*file.Folder, error) { func (i *fileFolderImporter) createFolderHierarchy(ctx context.Context, p string) (*file.Folder, error) {
parentPath := filepath.Dir(p) parentPath := filepath.Dir(p)
if parentPath == "." || parentPath == string(filepath.Separator) { if parentPath == p {
// get or create this folder // get or create this folder
return i.getOrCreateFolder(ctx, p, nil) return i.getOrCreateFolder(ctx, p, nil)
} }

View File

@@ -216,7 +216,7 @@ func (m *schema32Migrator) deletePlaceholderFolder(ctx context.Context) error {
func (m *schema32Migrator) createFolderHierarchy(p string) (*int, sql.NullInt64, error) { func (m *schema32Migrator) createFolderHierarchy(p string) (*int, sql.NullInt64, error) {
parent := filepath.Dir(p) parent := filepath.Dir(p)
if parent == "." || parent == string(filepath.Separator) { if parent == p {
// get or create this folder // get or create this folder
return m.getOrCreateFolder(p, nil, sql.NullInt64{}) return m.getOrCreateFolder(p, nil, sql.NullInt64{})
} }