@@ -90,7 +90,7 @@ public function installTranslations(string $appId, string $dirTranslations): str
9090 }
9191
9292 public function getExAppFolder (string $ appId ): ?string {
93- $ appsPaths = $ this ->config ->getSystemValue ('apps_paths ' );
93+ $ appsPaths = $ this ->config ->getSystemValue ('apps_paths ' , [] );
9494 $ existingPath = '' ;
9595 foreach ($ appsPaths as $ appPath ) {
9696 if ($ appPath ['writable ' ] && file_exists ($ appPath ['path ' ] . '/ ' . $ appId )) {
@@ -107,15 +107,27 @@ public function getExAppFolder(string $appId): ?string {
107107 }
108108 }
109109 }
110+ // Fallback to default ExApp folder
111+ $ defaultExAppFolder = \OC ::$ SERVERROOT . '/apps/ ' . $ appId ;
112+ if (is_dir ($ defaultExAppFolder )) {
113+ return $ defaultExAppFolder ;
114+ }
110115 return null ;
111116 }
112117
113118 public function removeExAppFolder (string $ appId ): void {
114- foreach ($ this ->config ->getSystemValue ('apps_paths ' ) as $ appPath ) {
115- if ($ appPath ['writable ' ]) {
116- if (file_exists ($ appPath ['path ' ] . '/ ' . $ appId )) {
117- $ this ->rmdirr ($ appPath ['path ' ] . '/ ' . $ appId );
118- }
119+ $ appsPaths = $ this ->config ->getSystemValue ('apps_paths ' , []);
120+ if (empty ($ appsPaths )) {
121+ // fallback check of default ExApp folder
122+ $ defaultExAppFolder = \OC ::$ SERVERROOT . '/apps/ ' . $ appId ;
123+ if (is_dir ($ defaultExAppFolder )) {
124+ $ this ->rmdirr ($ defaultExAppFolder );
125+ }
126+ return ;
127+ }
128+ foreach ($ appsPaths as $ appPath ) {
129+ if ($ appPath ['writable ' ] && file_exists ($ appPath ['path ' ] . '/ ' . $ appId )) {
130+ $ this ->rmdirr ($ appPath ['path ' ] . '/ ' . $ appId );
119131 }
120132 }
121133 }
0 commit comments