Skip to content

Commit

Permalink
Fix runtime error if the app resources directory doesn't exist.
Browse files Browse the repository at this point in the history
This can happen for Catalyst apps. Fixes Basedash#7
  • Loading branch information
raxityo committed Feb 1, 2023
1 parent 7236bef commit 0ea3bef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ async function getWhichAppsAreMissingFromDatabase(appNames) {

function getIconPath(appDirectory) {
var appResourcesDirectory = path.join(appDirectory, 'Contents', 'Resources');
// AppName.app/Contents/Resources may not exist for Catalyst apps.
if (!fs.pathExistsSync(appResourcesDirectory)) return null
const files = fs.readdirSync(appResourcesDirectory)
for (const file of files) {
if (file.endsWith('.icns')) {
Expand Down

0 comments on commit 0ea3bef

Please sign in to comment.