make sure the camera is not null when setting up the preview after measuring

This commit is contained in:
tibbi 2017-05-05 11:33:12 +02:00
parent 28bb406d42
commit c1ea435343

View File

@ -462,9 +462,11 @@ class Preview : ViewGroup, SurfaceHolder.Callback, MediaScannerConnection.OnScan
} }
if (mSetupPreviewAfterMeasure) { if (mSetupPreviewAfterMeasure) {
mSetupPreviewAfterMeasure = false if (mCamera != null) {
mCamera?.stopPreview() mSetupPreviewAfterMeasure = false
setupPreview() mCamera!!.stopPreview()
setupPreview()
}
} }
} }
} }