diff --git a/app/src/main/java/protect/card_locker/BarcodeImageWriterTask.java b/app/src/main/java/protect/card_locker/BarcodeImageWriterTask.java index 9ef6b7115..a03a52994 100644 --- a/app/src/main/java/protect/card_locker/BarcodeImageWriterTask.java +++ b/app/src/main/java/protect/card_locker/BarcodeImageWriterTask.java @@ -90,11 +90,6 @@ class BarcodeImageWriterTask extends AsyncTask public Bitmap doInBackground(Void... params) { - if (cardId.isEmpty()) - { - return null; - } - MultiFormatWriter writer = new MultiFormatWriter(); BitMatrix bitMatrix; try diff --git a/app/src/main/java/protect/card_locker/BarcodeSelectorActivity.java b/app/src/main/java/protect/card_locker/BarcodeSelectorActivity.java index 86c647c3b..43193647a 100644 --- a/app/src/main/java/protect/card_locker/BarcodeSelectorActivity.java +++ b/app/src/main/java/protect/card_locker/BarcodeSelectorActivity.java @@ -177,6 +177,12 @@ public class BarcodeSelectorActivity extends AppCompatActivity } }); + if (cardId.isEmpty()) + { + image.setVisibility(View.GONE); + return; + } + if(image.getHeight() == 0) { // The size of the ImageView is not yet available as it has not