Skip to content

Commit 90edb00

Browse files
committed
fix(Linkwarden): Ignore bookmarks with url = null
fixes #1788 Signed-off-by: Marcel Klehr <[email protected]>
1 parent 9785c42 commit 90edb00

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/lib/strategies/Default.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -386,16 +386,21 @@ export default class SyncProcess {
386386
}
387387

388388
filterOutInvalidBookmarks(tree: Folder<TItemLocation>): void {
389-
if (this.isFirefox) {
390-
tree.children = tree.children.filter(child => {
391-
if (child instanceof Bookmark) {
392-
return !child.url.startsWith('chrome')
393-
} else {
394-
this.filterOutInvalidBookmarks(child)
395-
return true
389+
tree.children = tree.children.filter(child => {
390+
if (child instanceof Bookmark) {
391+
// Chrome URLs cannot be added in firefox
392+
if (this.isFirefox && child.url.startsWith('chrome')) {
393+
return false
396394
}
397-
})
398-
}
395+
// Linkwarden supports bookmarks that have no URL eg. for directly uploaded files
396+
if (child.url === null) {
397+
return false
398+
}
399+
} else {
400+
this.filterOutInvalidBookmarks(child)
401+
}
402+
return true
403+
})
399404
}
400405

401406
async filterOutDuplicatesInTheSameFolder(tree: Folder<TItemLocation>): Promise<void> {

0 commit comments

Comments
 (0)