File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
owncloudApp/src/main/java/com/owncloud/android/ui/preview Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 88 * @author Juan Carlos Garrote Gascón
99 * @author Jorge Aguado Recio
1010 *
11- * Copyright (C) 2024 ownCloud GmbH.
11+ * Copyright (C) 2025 ownCloud GmbH.
1212 *
1313 *
1414 * This program is free software: you can redistribute it and/or modify
@@ -301,10 +301,14 @@ class PreviewImageActivity : FileActivity(),
301301 if (operationsServiceBinder != null ) {
302302 savedPosition = position
303303 hasSavedPosition = true
304- val currentFile = previewImagePagerAdapter.getFileAt(position)
305- updateActionBarTitle(currentFile.fileName)
306- if (! previewImagePagerAdapter.pendingErrorAt(position)) {
307- fileOperationsViewModel.performOperation(FileOperation .SynchronizeFileOperation (currentFile, account.name))
304+ if (previewImagePagerAdapter.count != 0 ) {
305+ val currentFile = previewImagePagerAdapter.getFileAt(position)
306+ updateActionBarTitle(currentFile.fileName)
307+ if (! previewImagePagerAdapter.pendingErrorAt(position)) {
308+ fileOperationsViewModel.performOperation(FileOperation .SynchronizeFileOperation (currentFile, account.name))
309+ }
310+ } else {
311+ backToDisplayActivity()
308312 }
309313
310314 // Call to reset image zoom to initial state
You can’t perform that action at this time.
0 commit comments