Skip to content

Commit

Permalink
Trying to track down NullPointerException in USB input thread
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 8, 2018
1 parent 4d771c5 commit e4c9806
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -276,7 +276,16 @@ public void run() {
int packetSize = mInputEndpoint.getMaxPacketSize();
byte[] packet = new byte[packetSize];
while (mRunning) {
int r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
int r;
try
{
r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
}
catch (Exception e)
{
Log.v(TAG, "Exception in UsbDeviceConnection bulktransfer: " + e);
break;
}
if (r < 0) {
// Could be a timeout or an I/O error
}
Expand Down

0 comments on commit e4c9806

Please sign in to comment.