Skip to content

Commit

Permalink
bug fixed: null reference exception (#47)
Browse files Browse the repository at this point in the history
* Update BarcodeLib.cs

* Update BarcodeLib.cs
  • Loading branch information
teunlielu authored and barnhill committed Jun 2, 2018
1 parent 5db78da commit 7d04599
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BarcodeLib/BarcodeLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 7d04599

Please sign in to comment.