kkohase / usb-serial-for-android

Automatically exported from code.google.com/p/usb-serial-for-android
GNU Lesser General Public License v3.0
0 stars 0 forks source link

NullPointerException thrown if no driver is aviable #34

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If no drivers are aviable for usb device UsbSerialProber.probeSingleDevice(...) 
method throws NullPointerException.

After small change in implementation of this method (additional if) everything 
looks ok.

Proposed new wersion of the method, commented additional line if 
(probedDevices!= null)
-----------------------------------------------------------------------
public static List<UsbSerialDriver> probeSingleDevice(final UsbManager 
usbManager,
            UsbDevice usbDevice) {
        final List<UsbSerialDriver> result = new ArrayList<UsbSerialDriver>();
        for (final UsbSerialProber prober : values()) {
            final List<UsbSerialDriver> probedDevices = prober.probe(usbManager, usbDevice);
            if (probedDevices!= null)          \\additional line to solve the problem
                result.addAll(probedDevices);
        }
        return result;
    }
------------------------------------------------------------------------

What version of the product are you using? On what operating system?
Library in newest version, was downloaded yesterday (17-07-2013).
Used on GalaxyTab2 Android v. 4.1.1

Original issue reported on code.google.com by krzyszto...@gmail.com on 18 Jul 2013 at 2:36

GoogleCodeExporter commented 9 years ago
moved to github: https://github.com/mik3y/usb-serial-for-android/issues/34

Original comment by mike.wak...@gmail.com on 13 Sep 2013 at 4:39