diff --git a/lib/Service/GoogleDriveAPIService.php b/lib/Service/GoogleDriveAPIService.php index 30aacf34..b504ab6a 100644 --- a/lib/Service/GoogleDriveAPIService.php +++ b/lib/Service/GoogleDriveAPIService.php @@ -253,6 +253,7 @@ public function importFiles( string $userId, string $targetPath, string $targetSharedPath, ?int $maxDownloadSize = null, array &$directoryProgress = [], ): array { + $rootSharedWithMeImportFolder = null; $considerSharedFiles = $this->userConfig->getValueString($userId, APPLICATION::APP_ID, 'consider_shared_files', '0', lazy:true) === '1'; // create root folder(s) @@ -892,7 +893,7 @@ private function retrieveFiles(string $userId, string $dirId, string $query, boo } if (!isset($saveFolder)) { - if ($dirId === 'sharedRoot') { + if ($dirId === 'sharedRoot' && $rootSharedWithMeImportFolder !== null) { $saveFolder = $rootSharedWithMeImportFolder; } else { $saveFolder = $rootImportFolder;