Skip to content

Commit 11a4358

Browse files
committed
fix(Bookmark): Accept url = null
see #1788 Signed-off-by: Marcel Klehr <[email protected]>
1 parent 9d01506 commit 11a4358

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/lib/Tree.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ export class Bookmark<L extends TItemLocation> {
5252
throw new Error('Location failed validation')
5353
}
5454

55-
// not a regular bookmark
56-
if (STRANGE_PROTOCOLS.some(proto => url.indexOf(proto) === 0)) {
57-
this.url = url
58-
return
59-
}
60-
6155
try {
56+
// not a regular bookmark
57+
if (STRANGE_PROTOCOLS.some(proto => url.indexOf(proto) === 0)) {
58+
this.url = url
59+
return
60+
}
61+
6262
const urlObj = new URL(url)
6363
this.url = urlObj.href
6464
} catch (e) {

0 commit comments

Comments
 (0)