From 0306f9e61908f80751148017a20fda4982c819fd Mon Sep 17 00:00:00 2001 From: arabcoders Date: Tue, 3 Jun 2025 17:01:38 +0300 Subject: [PATCH] Add try catch block for url decoding. Fix #287 --- ui/utils/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/utils/index.js b/ui/utils/index.js index d7fefd9d..2998280a 100644 --- a/ui/utils/index.js +++ b/ui/utils/index.js @@ -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 + } } /**