diff --git a/kDrive/UI/Controller/Menu/Share/PublicShareViewModel.swift b/kDrive/UI/Controller/Menu/Share/PublicShareViewModel.swift index caac30f3d..45cf23c11 100644 --- a/kDrive/UI/Controller/Menu/Share/PublicShareViewModel.swift +++ b/kDrive/UI/Controller/Menu/Share/PublicShareViewModel.swift @@ -152,10 +152,14 @@ final class PublicShareViewModel: InMemoryFileListViewModel { } private func addToMyDrive(sender: Any?, publicShareProxy: PublicShareProxy) { + guard let currentUserDriveFileManager = accountManager.currentDriveFileManager else { + return + } + let selectedItemsIds = multipleSelectionViewModel?.selectedItems.map(\.id) ?? [] + [rootProxy.id] let exceptItemIds = multipleSelectionViewModel?.exceptItemIds.map { $0 } ?? [] - let saveViewController = SaveFileViewController.instantiate(driveFileManager: driveFileManager) + let saveViewController = SaveFileViewController.instantiate(driveFileManager: currentUserDriveFileManager) let saveNavigationViewController = SaveFileViewController .setInNavigationController(saveViewController: saveViewController)