summaryrefslogtreecommitdiff
path: root/gusb/gusb-source.c
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2014-11-20 10:23:55 +0000
committerRichard Hughes <richard@hughsie.com>2014-11-20 10:23:55 +0000
commita5e62b7d078520f79f7b5c9dfc3492091b60530f (patch)
treede54c9f5650c9c05a1f015c4403bf20e67046a04 /gusb/gusb-source.c
parent3b68de9634f47d9b4b837c3d9144cf03fd356465 (diff)
downloadgusb-a5e62b7d078520f79f7b5c9dfc3492091b60530f.tar.gz
Fix a crash where libusb_get_pollfds() is unavailable
Diffstat (limited to 'gusb/gusb-source.c')
-rw-r--r--gusb/gusb-source.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gusb/gusb-source.c b/gusb/gusb-source.c
index 08325bc..4e06658 100644
--- a/gusb/gusb-source.c
+++ b/gusb/gusb-source.c
@@ -247,7 +247,7 @@ _g_usb_source_new (GMainContext *main_ctx,
/* watch the fd's already created */
pollfds = libusb_get_pollfds (gusb_source->ctx);
- for (i=0; pollfds[i] != NULL; i++)
+ for (i = 0; pollfds != NULL && pollfds[i] != NULL; i++)
g_usb_source_pollfd_add (gusb_source,
pollfds[i]->fd,
pollfds[i]->events);