Skip to content

Commit 22c7520

Browse files
fix: guard against undefined m.url (#1086)
1 parent 27f2f9f commit 22c7520

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/helix-shared-config/src/MountConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function stripQuery(m, ...specialparams) {
4444

4545
const onedriveDecorator = {
4646
test(m) {
47-
return /^https:\/\/[a-z0-9-]+\.sharepoint\.com\//.test(m.url) || m.url.startsWith('https://1drv.ms/') || m.url.startsWith('onedrive:');
47+
return /^https:\/\/[a-z0-9-]+\.sharepoint\.com\//.test(m.url) || m.url?.startsWith('https://1drv.ms/') || m.url?.startsWith('onedrive:');
4848
},
4949
decorate(m) {
5050
return {
@@ -56,7 +56,7 @@ const onedriveDecorator = {
5656

5757
const googleDecorator = {
5858
test(m) {
59-
return m.url.startsWith('https://drive.google.com/') || m.url.startsWith('gdrive:');
59+
return m.url?.startsWith('https://drive.google.com/') || m.url?.startsWith('gdrive:');
6060
},
6161
decorate(m) {
6262
const url = new URL(m.url);

0 commit comments

Comments
 (0)