From dc37d3bf624b439911a100ec3c6ecdb9fddadd68 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Tue, 29 Sep 2015 16:21:35 +0200 Subject: [PATCH] ratbagd: ignore NULL profiles Never return information about non-existant profiles. Just skip NULL profiles silently, when iterating. Signed-off-by: David Herrmann --- src/ratbagd-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ratbagd-device.c b/src/ratbagd-device.c index 4756c265..b9c8eb2a 100644 --- a/src/ratbagd-device.c +++ b/src/ratbagd-device.c @@ -74,7 +74,7 @@ static int ratbagd_device_find_profile(sd_bus *bus, if (r < 0) return 0; - if (index >= device->n_profiles) + if (index >= device->n_profiles || !device->profiles[index]) return 0; *found = device->profiles[index];