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:
Bastien Nocera 2018-10-11 14:58:04 +02:00
parent c88a51cce8
commit 46ebb39f65

View file

@ -259,8 +259,7 @@ API_EXPORTED struct fp_dscv_dev **fp_discover_devs(void)
int r;
int i = 0;
if (registered_drivers == NULL)
return NULL;
g_return_val_if_fail (registered_drivers != NULL, NULL);
r = libusb_get_device_list(fpi_usb_ctx, &devs);
if (r < 0) {