Add try catch block for url decoding. Fix #287
This commit is contained in:
parent
5af4655429
commit
0306f9e619
1 changed files with 6 additions and 1 deletions
|
|
@ -221,7 +221,12 @@ const encodePath = item => {
|
||||||
}
|
}
|
||||||
|
|
||||||
item = item.replace(/#/g, '%23')
|
item = item.replace(/#/g, '%23')
|
||||||
return item.split('/').map(decodeURIComponent).map(encodeURIComponent).join('/')
|
try {
|
||||||
|
return item.split('/').map(decodeURIComponent).map(encodeURIComponent).join('/')
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error encoding path:', e, item)
|
||||||
|
return item
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue