From 3f2e24cf5d35727037e02022d2622089563c6745 Mon Sep 17 00:00:00 2001 From: srowen Date: Thu, 6 Nov 2008 19:14:48 +0000 Subject: [PATCH] Small additional error check in decoder git-svn-id: http://zxing.googlecode.com/svn/trunk@674 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- core/src/com/google/zxing/datamatrix/detector/Detector.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/com/google/zxing/datamatrix/detector/Detector.java b/core/src/com/google/zxing/datamatrix/detector/Detector.java index 28c727e0..aa0b426f 100644 --- a/core/src/com/google/zxing/datamatrix/detector/Detector.java +++ b/core/src/com/google/zxing/datamatrix/detector/Detector.java @@ -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 ResultPoint[] corners = new ResultPoint[] { maybeTopLeft, bottomLeft, maybeBottomRight }; // Use the dot product trick to sort them out -- 2.20.1