From 1efbcb2b87b17a82f2b3d873d1c9cc1c6a3a9b77 Mon Sep 17 00:00:00 2001 From: Nick Kelsey Date: Thu, 13 Oct 2016 14:03:09 -0700 Subject: [PATCH] handle discovery error condition --- hdhomerun_device_selector.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hdhomerun_device_selector.c b/hdhomerun_device_selector.c index 9367cf2..a60d3be 100644 --- a/hdhomerun_device_selector.c +++ b/hdhomerun_device_selector.c @@ -127,6 +127,9 @@ static int hdhomerun_device_selector_load_from_str_discover(struct hdhomerun_dev { struct hdhomerun_discover_device_t result; int discover_count = hdhomerun_discover_find_devices_custom_v2(target_ip, HDHOMERUN_DEVICE_TYPE_TUNER, device_id, &result, 1); + if (discover_count != 1) { + return 0; + } int count = 0; unsigned int tuner_index;