mirror of
https://github.com/zxing/zxing.git
synced 2025-01-12 19:57:27 -08:00
Add a double-check for null SurfaceHolder
git-svn-id: https://zxing.googlecode.com/svn/trunk@2258 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
8c924b470f
commit
26d5ff4355
|
@ -721,6 +721,9 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
|
|||
}
|
||||
|
||||
private void initCamera(SurfaceHolder surfaceHolder) {
|
||||
if (surfaceHolder == null) {
|
||||
throw new IllegalStateException("No SurfaceHolder provided");
|
||||
}
|
||||
try {
|
||||
cameraManager.openDriver(surfaceHolder);
|
||||
// Creating the handler starts the preview, which can also throw a RuntimeException.
|
||||
|
|
Loading…
Reference in a new issue