Check for empty cardId in BarcodeSelectorActivity instead

This commit is contained in:
Sylvia van Os
2019-12-11 10:44:31 +01:00
parent 19755f4f86
commit 62f7241bca
2 changed files with 6 additions and 5 deletions

View File

@@ -90,11 +90,6 @@ class BarcodeImageWriterTask extends AsyncTask<Void, Void, Bitmap>
public Bitmap doInBackground(Void... params)
{
if (cardId.isEmpty())
{
return null;
}
MultiFormatWriter writer = new MultiFormatWriter();
BitMatrix bitMatrix;
try

View File

@@ -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