Using latest stable package on NuGet, 2.16.2905
Encountering an issue where a null reference exception occurrs within the SDK. Specifically it occurrs in Zebra.SDK.Comm in DriverPrinterConnection with the method BytesAvailable(). Specifically line 176, ReadFromPrinter() is returning null and there is nothing in place to ensure that the value is not null.
Currently
byte[] temporaryReadBuffer = ReadFromPrinter();
if (temporaryReadBuffer.Length < 0)
{
throw new ConnectionException("Failed to read from the USB port: " + PrinterName);
}
Suggesting change
byte[] temporaryReadBuffer = ReadFromPrinter();
if (temporaryReadBuffer == null)
{
throw new ConnectionException("Failed to read from the USB port: " + PrinterName);
}
1 Replies
Thanks for pointing this out. It should have been fixed in Zebra.Printer.SDK v3.0.3271, which is available on NuGet.