lib: Throw an error if fp_init() wasn't called
You can't call fp_discover_devs() without calling fp_init() and having it not fail, otherwise there's nothing to discover...
This commit is contained in:
parent
c88a51cce8
commit
46ebb39f65
1 changed files with 1 additions and 2 deletions
|
@ -259,8 +259,7 @@ API_EXPORTED struct fp_dscv_dev **fp_discover_devs(void)
|
||||||
int r;
|
int r;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
if (registered_drivers == NULL)
|
g_return_val_if_fail (registered_drivers != NULL, NULL);
|
||||||
return NULL;
|
|
||||||
|
|
||||||
r = libusb_get_device_list(fpi_usb_ctx, &devs);
|
r = libusb_get_device_list(fpi_usb_ctx, &devs);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
|
Loading…
Reference in a new issue