Explorar o código

fix(apps.helpers.ts): check folder existense before accesing it

Nicolas Meienberger %!s(int64=2) %!d(string=hai) anos
pai
achega
21cec26e06
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      packages/system-api/src/modules/apps/apps.helpers.ts

+ 3 - 1
packages/system-api/src/modules/apps/apps.helpers.ts

@@ -164,7 +164,9 @@ export const getAppInfo = (id: string, status?: AppStatusEnum): AppInfo | null =
 export const getUpdateInfo = async (id: string) => {
   const app = await App.findOne({ where: { id } });
 
-  if (!app) {
+  const doesFileExist = fileExists(`/repos/${config.APPS_REPO_ID}/apps/${id}`);
+
+  if (!app || !doesFileExist) {
     return null;
   }