From 74c4f04a07206dc4d6e216817473d13b513df45f Mon Sep 17 00:00:00 2001 From: dgreif Date: Mon, 8 Feb 2016 21:31:28 -0600 Subject: [PATCH] refactor: move result check to higher level --- src/quagga.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/quagga.js b/src/quagga.js index 042d738..031c68d 100644 --- a/src/quagga.js +++ b/src/quagga.js @@ -164,7 +164,7 @@ function transformResult(result) { yOffset = topRight.y, i; - if (!result || (xOffset === 0 && yOffset === 0)) { + if (xOffset === 0 && yOffset === 0) { return; } @@ -204,7 +204,7 @@ function transformResult(result) { function addResult (result, imageData) { var i; - if (!imageData || !result || !_resultCollector) { + if (!imageData || !_resultCollector) { return; } @@ -221,7 +221,7 @@ function addResult (result, imageData) { } function publishResult(result, imageData) { - if (_onUIThread) { + if (result && _onUIThread) { transformResult(result); addResult(result, imageData); }