one more null check

This commit is contained in:
tibbi
2016-04-19 13:27:43 +02:00
parent d3d2f5e23d
commit be831f1e91

View File

@ -210,9 +210,10 @@ public class Preview extends ViewGroup implements SurfaceHolder.Callback, View.O
private void setupPreview() {
canTakePicture = true;
if (camera != null) {
if (camera != null && previewSize != null) {
final Camera.Parameters parameters = camera.getParameters();
parameters.setPreviewSize(previewSize.width, previewSize.height);
requestLayout();
camera.setParameters(parameters);