Another protection against early view calls before camera init (issue 1254)

git-svn-id: https://zxing.googlecode.com/svn/trunk@2274 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-04-27 11:31:09 +00:00
parent 9a94f713db
commit 3926c96fc1

View file

@ -178,6 +178,10 @@ public final class CameraManager {
return null;
}
Point screenResolution = configManager.getScreenResolution();
if (screenResolution == null) {
// Called early, before init even finished
return null;
}
int width = screenResolution.x * 3 / 4;
if (width < MIN_FRAME_WIDTH) {
width = MIN_FRAME_WIDTH;