From 656a01f2fab7fc04851bcbca534cbbe882b707cd Mon Sep 17 00:00:00 2001 From: KernelDeimos <7225168+KernelDeimos@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:45:48 -0500 Subject: [PATCH] fix: error calling .startsWith on null mime_type According to the package documentation: https://www.npmjs.com/package/mime > null is returned in cases where an extension is not detected or recognized This call to `.startsWith()` was causing an exception to be thrown upon right-clicking files without an extension, making it impossible to fix them. --- src/gui/src/UI/UIItem.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/src/UI/UIItem.js b/src/gui/src/UI/UIItem.js index 35519e45..f502aafe 100644 --- a/src/gui/src/UI/UIItem.js +++ b/src/gui/src/UI/UIItem.js @@ -1281,7 +1281,8 @@ function UIItem(options){ // ------------------------------------------- // Set as Wallpaper // ------------------------------------------- - const mime_type = mime.getType($(el_item).attr('data-name')); + const mime_type = mime.getType($(el_item).attr('data-name')) ?? + 'application/octet-stream'; if(!is_trashed && !is_trash && !options.is_dir && mime_type.startsWith('image/')) { menu_items.push({ html: i18n('set_as_background'),