Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.NullReferenceException: Object reference not set to an instance of an object. #16

Open
enriquerdz opened this issue Dec 16, 2020 · 4 comments

Comments

@enriquerdz
Copy link

System.NullReferenceException: Object reference not set to an instance of an object.
at NetBarcode.Types.EAN13.GetEncoding()} | System.NullReferenceException

CODE:

var barcode = new Barcode(newStringValue, TypeNet.EAN13, true); <--- Exception origen

use implement

using NetBarcode;
using TypeNet = NetBarcode.Type;

Ambient:

Ubuntu 20.04
NetCore 3.1

@Tagliatti
Copy link
Owner

Hi, you install some native dependencies?

sudo apt install libc6-dev 
sudo apt install libgdiplus

@enriquerdz
Copy link
Author

I have installed the depencencies that you comment and it keeps giving the error.

@Tagliatti
Copy link
Owner

If you use (new Barcode("543534")).GetImage(); it works?

@CarlosEvandro-Fi
Copy link

In my case this NullReferenceException was caused by country three digit code check, because the first three digit are 000, at:
https://github.com/Tagliatti/NetBarcode/blob/master/NetBarcode/Types/EAN13.cs
line 90
Its not stopped my app because the next check of two digit code does not throw an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants