diff --git a/src/renderer/coremods/commands/index.ts b/src/renderer/coremods/commands/index.ts index c492911ed..8d0fa9dc4 100644 --- a/src/renderer/coremods/commands/index.ts +++ b/src/renderer/coremods/commands/index.ts @@ -223,13 +223,13 @@ async function injectApplicationCommandSearchStore(): Promise { ); if (!commandAndSectionsArray.length) return; if ( - !commandAndSectionsArray.every((commandAndSection) => - res.some((section) => section.id === commandAndSection.section.id), + !commandAndSectionsArray.every( + (commandAndSection) => res?.some((section) => section.id === commandAndSection.section.id), ) ) { const sectionsToAdd = commandAndSectionsArray .map((commandAndSection) => commandAndSection.section) - .filter((section) => res.some((existingSections) => section.id === existingSections.id)); + .filter((section) => res?.some((existingSections) => section.id === existingSections.id)); res.push(...sectionsToAdd); } return res; diff --git a/src/renderer/modules/webpack/filters.ts b/src/renderer/modules/webpack/filters.ts index 95cc7dc4a..f8cb6e9c0 100644 --- a/src/renderer/modules/webpack/filters.ts +++ b/src/renderer/modules/webpack/filters.ts @@ -9,7 +9,7 @@ import type { ByPropsOptions, RawModule } from "../../../types"; export const byProps =

( ...args: [...P[], ByPropsOptions] | P[] ): ((m: RawModule) => boolean) => { - if (typeof args.at(-1) === "object" && !Array.isArray(args.at(-1)) && args.at(-1) !== null) { + if (typeof args.at(-1) === "object" && !Array.isArray(args.at(-1)) && args.at(-1)) { const options = args.pop() as ByPropsOptions; return (m: RawModule) => typeof getExportsForProps(m.exports, args as P[], options) !== "undefined";