Small additional error check in decoder
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 6 Nov 2008 19:14:48 +0000 (19:14 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 6 Nov 2008 19:14:48 +0000 (19:14 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@674 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/datamatrix/detector/Detector.java

index 28c727e..aa0b426 100644 (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
     ResultPoint[] corners = new ResultPoint[] { maybeTopLeft, bottomLeft, maybeBottomRight };
     // Use the dot product trick to sort them out