sftp: fix crash when app has no addons

This commit is contained in:
Girish Ramakrishnan
2023-11-13 21:58:44 +01:00
parent 804a3f8adb
commit 1a43c05d48
+1 -1
View File
@@ -67,7 +67,7 @@ async function start(existingInfra) {
// custom app data directories
const allApps = await apps.list();
for (const app of allApps) {
if (!app.manifest.addons['localstorage'] || !app.storageVolumeId) continue;
if (!app.manifest.addons?.localstorage || !app.storageVolumeId) continue;
const hostDir = await apps.getStorageDir(app), mountDir = `/mnt/app-${app.id}`; // see also sftp:userSearchSftp
if (!safe.fs.existsSync(hostDir)) { // this can fail if external mount does not have permissions for yellowtent user