Fix error when missing manifest.ui is treated like a file to be opened (#365)
commit313c27032a32550742c00d3e879139b8b21dd965
authorco-odw <131208219+co-odw@users.noreply.github.com>
Wed, 6 Mar 2024 14:37:02 +0000 (6 09:37 -0500)
committerGitHub <noreply@github.com>
Wed, 6 Mar 2024 14:37:02 +0000 (6 17:37 +0300)
tree54e3369b78e8ef1bb10a45dfa2f6559420a264db
parent4ff0feac2f38275de9b0d868aa2e59137e3a68e1
Fix error when missing manifest.ui is treated like a file to be opened (#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 <connor@cdosborn.com>
src/main/ExtensionManager.ts