Don't crash when no devices are present
This commit is contained in:
parent
73561989dd
commit
9608ab3707
1 changed files with 6 additions and 4 deletions
|
@ -464,10 +464,12 @@ static struct fp_driver *find_supporting_driver(libusb_device *udev,
|
|||
}
|
||||
} while ((elem = g_slist_next(elem)));
|
||||
|
||||
fp_dbg("selected driver %s supports USB device %04x:%04x",
|
||||
best_drv->name, dsc.idVendor, dsc.idProduct);
|
||||
*devtype = best_devtype;
|
||||
*usb_id = best_usb_id;
|
||||
if (best_drv != NULL) {
|
||||
fp_dbg("selected driver %s supports USB device %04x:%04x",
|
||||
best_drv->name, dsc.idVendor, dsc.idProduct);
|
||||
*devtype = best_devtype;
|
||||
*usb_id = best_usb_id;
|
||||
}
|
||||
|
||||
return best_drv;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue