Fixed crash while taking barcode photo.