Skip to content

Commit 08e0f43

Browse files
Merge pull request #17322 from nextcloud/fix/preview-text-fragment-finish
fix(preview-text-fragment): finish
2 parents 9bc7c1f + 9a43918 commit 08e0f43

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

app/src/main/java/com/owncloud/android/ui/preview/PreviewTextFragment.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,9 @@ abstract class PreviewTextFragment :
162162
}
163163
}
164164

165-
/**
166-
* Finishes the preview
167-
*/
168165
protected fun finish() {
169-
requireActivity().runOnUiThread { requireActivity().onBackPressedDispatcher.onBackPressed() }
166+
val activity = activity ?: return
167+
activity.runOnUiThread { activity.onBackPressedDispatcher.onBackPressed() }
170168
}
171169

172170
companion object {

0 commit comments

Comments
 (0)