diff --git a/toolkit/modules/ShortcutUtils.sys.mjs b/toolkit/modules/ShortcutUtils.sys.mjs
index 3e796cb6586ad39257a29c2a6da1d0415f4c2676..dd883f81612d9dc892e720b63e2793e43b9686b3 100644
--- a/toolkit/modules/ShortcutUtils.sys.mjs
+++ b/toolkit/modules/ShortcutUtils.sys.mjs
@@ -140,6 +140,7 @@ export var ShortcutUtils = {
         key = keyCode.replace(/^VK_/, "");
       }
     } else {
+      if (!keyAttribute) return "";
       key = keyAttribute.toUpperCase();
     }
 
