From 7d04599b7129d83af40949fbb390ff525e4dcef8 Mon Sep 17 00:00:00 2001 From: teunlielu Date: Sun, 3 Jun 2018 00:36:43 +0200 Subject: [PATCH] bug fixed: null reference exception (#47) * Update BarcodeLib.cs * Update BarcodeLib.cs --- BarcodeLib/BarcodeLib.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BarcodeLib/BarcodeLib.cs b/BarcodeLib/BarcodeLib.cs index a89cfdc..5f1e904 100644 --- a/BarcodeLib/BarcodeLib.cs +++ b/BarcodeLib/BarcodeLib.cs @@ -608,7 +608,7 @@ private Bitmap Generate_Image() if (IncludeLabel) { - if ((RawData.StartsWith(AlternateLabel) || (AlternateLabel == null)) && _StandardizeLabel == true) + if ((AlternateLabel == null || RawData.StartsWith(AlternateLabel)) && _StandardizeLabel == true) { // UPCA standardized label string defTxt = RawData; @@ -665,7 +665,7 @@ private Bitmap Generate_Image() }//using if (IncludeLabel) { - if ((RawData.StartsWith(AlternateLabel) || AlternateLabel == null) && _StandardizeLabel == true) + if ((AlternateLabel == null || RawData.StartsWith(AlternateLabel)) && _StandardizeLabel == true) { Labels.Label_UPCA(this, bitmap); } @@ -707,7 +707,7 @@ private Bitmap Generate_Image() if (IncludeLabel) { - if ((RawData.StartsWith(AlternateLabel) || (AlternateLabel == null)) && _StandardizeLabel == true) + if ((AlternateLabel == null || RawData.StartsWith(AlternateLabel)) && _StandardizeLabel == true) { // EAN13 standardized label string defTxt = RawData; @@ -763,7 +763,7 @@ private Bitmap Generate_Image() }//using if (IncludeLabel) { - if ((RawData.StartsWith(AlternateLabel) || AlternateLabel == null) && _StandardizeLabel == true) + if ((AlternateLabel == null || RawData.StartsWith(AlternateLabel)) && _StandardizeLabel == true) { Labels.Label_EAN13(this, bitmap); }