Skip to content

Commit b6834e2

Browse files
committed
add a zoom check before trying to get zoom ratios
1 parent 0fb37c7 commit b6834e2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • app/src/main/kotlin/com/simplemobiletools/camera

app/src/main/kotlin/com/simplemobiletools/camera/Preview.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
141141

142142
mParameters = mCamera!!.parameters
143143
mMaxZoom = mParameters!!.maxZoom
144-
mZoomRatios = mParameters!!.zoomRatios as ArrayList<Int>
144+
145+
if (mParameters!!.isZoomSupported)
146+
mZoomRatios = mParameters!!.zoomRatios as ArrayList<Int>
147+
145148
mSupportedPreviewSizes = mParameters!!.supportedPreviewSizes.sortedByDescending { it.width * it.height }
146149
refreshPreview()
147150

0 commit comments

Comments
 (0)