Small additional error check in decoder

git-svn-id: https://zxing.googlecode.com/svn/trunk@674 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2008-11-06 19:14:48 +00:00
parent 034b6ef1f2
commit 56644b1af2

View file

@ -129,6 +129,10 @@ public final class Detector {
} }
} }
if (maybeTopLeft == null || bottomLeft == null || maybeBottomRight == null) {
throw new ReaderException("Could not find three corners");
}
// Bottom left is correct but top left and bottom right might be switched // Bottom left is correct but top left and bottom right might be switched
ResultPoint[] corners = new ResultPoint[] { maybeTopLeft, bottomLeft, maybeBottomRight }; ResultPoint[] corners = new ResultPoint[] { maybeTopLeft, bottomLeft, maybeBottomRight };
// Use the dot product trick to sort them out // Use the dot product trick to sort them out