Skip to content

Commit

Permalink
Fix error when missing manifest.ui is treated like a file to be opened (
Browse files Browse the repository at this point in the history
#365)

This error would surface as:
Error occurred in handler for 'createMultipleNewLocalFileExtensions': TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of t
ype string. Received undefined
    at new NodeError (node:internal/errors:405:5)
    at validateString (node:internal/validators:162:11)
    at Object.extname (node:path:1385:5)
    at _hasFigmaSession.validateFileName (/proj/figma-linux/dist/main/main.js:1:69605)
    at _hasFigmaSession.validateExtensionFiles (/proj/figma-linux/dist/main/main.js:1:70078)
    at _hasFigmaSession.addExtension (/proj/figma-linux/dist/main/main.js:1:68834)
    at o (/proj/figma-linux/dist/main/main.js:1:71542)
    at async Promise.all (index 0)
    at async _hasFigmaSession.createMultipleNewLocalFileExtensions (/proj/figma-linux/dist/main/main.js:1:71629)
    at async WebContents.<anonymous> (node:electron/js2c/browser_init:2:88640) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Co-authored-by: Connor Osborn <[email protected]>
  • Loading branch information
co-odw and cdosborn authored Mar 6, 2024
1 parent 4ff0fea commit 313c270
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/ExtensionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ export default class ExtensionManager {
for (const file of Object.values(manifestJson.ui)) {
files.push({ name: file, content: "" });
}
} else {
} else if (typeof manifestJson.ui === "string") {
files.push({ name: manifestJson.ui, content: "" });
}

Expand Down

0 comments on commit 313c270

Please sign in to comment.