Add try catch block for url decoding. Fix #287

This commit is contained in:
arabcoders 2025-06-03 17:01:38 +03:00
parent 5af4655429
commit 0306f9e619

View file

@ -221,7 +221,12 @@ const encodePath = item => {
}
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
}
}
/**