Snapcam: Fix NullPointerException for Monkey test
Fix NullPointerException for Monkey test.
Change-Id: Ibb79d038d52f296c0b5f919e776609288dc7b0eb
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 06ba448..08dd017 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -2639,7 +2639,9 @@
}
}
} else {
- captureBuilder.addTarget(mVideoSnapshotImageReader.getSurface());
+ if(mVideoSnapshotImageReader != null) {
+ captureBuilder.addTarget(mVideoSnapshotImageReader.getSurface());
+ }
}
// send snapshot stream together with preview and video stream for snapshot request
// stream is the surface for the app