LinkOS Multiplatform SDK Null ref exception

// Expert user has replied.
R Rob Deans 2 weeks ago
24 1 0

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);
}
	
CONTACT
Can’t find what you’re looking for?