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)));
|
} while ((elem = g_slist_next(elem)));
|
||||||
|
|
||||||
fp_dbg("selected driver %s supports USB device %04x:%04x",
|
if (best_drv != NULL) {
|
||||||
best_drv->name, dsc.idVendor, dsc.idProduct);
|
fp_dbg("selected driver %s supports USB device %04x:%04x",
|
||||||
*devtype = best_devtype;
|
best_drv->name, dsc.idVendor, dsc.idProduct);
|
||||||
*usb_id = best_usb_id;
|
*devtype = best_devtype;
|
||||||
|
*usb_id = best_usb_id;
|
||||||
|
}
|
||||||
|
|
||||||
return best_drv;
|
return best_drv;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue