diff --git a/CHANGELOG.md b/CHANGELOG.md index be3295711..8bbc355a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - 82 (2021-09-03) - Improved support for screen readers +- Don't crash when trying to open a video from gallery ## v2.4.0 - 81 (2021-08-29) diff --git a/app/src/main/java/protect/card_locker/ScanActivity.java b/app/src/main/java/protect/card_locker/ScanActivity.java index 3b6917962..fba311164 100644 --- a/app/src/main/java/protect/card_locker/ScanActivity.java +++ b/app/src/main/java/protect/card_locker/ScanActivity.java @@ -10,6 +10,7 @@ import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; import android.view.View; +import android.widget.Toast; import androidx.appcompat.app.ActionBar; import androidx.appcompat.widget.Toolbar; @@ -168,7 +169,14 @@ public class ScanActivity extends CatimaAppCompatActivity { { super.onActivityResult(requestCode, resultCode, intent); - BarcodeValues barcodeValues = Utils.parseSetBarcodeActivityResult(requestCode, resultCode, intent, this); + BarcodeValues barcodeValues; + + try { + barcodeValues = Utils.parseSetBarcodeActivityResult(requestCode, resultCode, intent, this); + } catch (NullPointerException e) { + Toast.makeText(this, R.string.errorReadingImage, Toast.LENGTH_LONG).show(); + return; + } if (!barcodeValues.isEmpty()) { Intent manualResult = new Intent();