Catch runtime exceptions from QR code decoder. #298

This commit is contained in:
akwizgran
2016-04-15 17:06:05 +01:00
parent 0f9338f5e9
commit 6197f5a44c

View File

@@ -77,6 +77,8 @@ public class QrCodeDecoder implements PreviewConsumer, PreviewCallback {
result = reader.decode(bitmap);
} catch (ReaderException e) {
return null; // No barcode found
} catch (RuntimeException e) {
return null; // Decoding failed due to bug in decoder
} finally {
reader.reset();
}