From baf6c36bcd6dd02f635a119f237a4fe35cabaf2c Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 30 Mar 2017 22:02:25 +0200 Subject: [PATCH] fix a crash at getting -1th element of an array --- .../simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt b/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt index b317ad86..46918ac8 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/dialogs/ChangeResolutionDialog.kt @@ -33,6 +33,7 @@ class ChangeResolutionDialog(val activity: SimpleActivity, val isBackCamera: Boo private fun setupPhotoResolutionPicker(view: View) { val items = getFormattedResolutions(camera.parameters.supportedPictureSizes) var selectionIndex = if (isBackCamera) config.backPhotoResIndex else config.frontPhotoResIndex + selectionIndex = Math.max(selectionIndex, 0) view.change_resolution_photo_holder.setOnClickListener { RadioGroupDialog(activity, items, selectionIndex) {