Skip to content

Commit

Permalink
Fix runtime error if the app directory doesn't exist.
Browse files Browse the repository at this point in the history
This can happen for spacer-tiles. Fixes Basedash#1
  • Loading branch information
raxityo committed Feb 1, 2023
1 parent 839c4de commit 7236bef
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ function getAppNamesToIconPaths(parsedDockData) {

for (const parsedAppData of persistentApps) {
const appName = parsedAppData.dict[0].string[1];
const appDirectoryUrl = parsedAppData.dict[0].dict[0].string[0];
const appDirectory = url.fileURLToPath(appDirectoryUrl)

if (isAppNameAllowed(appName)) {
const appDirectoryUrl = parsedAppData.dict[0].dict?.[0].string[0];
if (appDirectoryUrl && isAppNameAllowed(appName)) {
const appDirectory = url.fileURLToPath(appDirectoryUrl)
result[appName] = getIconPath(appDirectory);
}
}
Expand Down

0 comments on commit 7236bef

Please sign in to comment.