ratbagd: ignore NULL profiles

Never return information about non-existant profiles. Just skip NULL
profiles silently, when iterating.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
David Herrmann
2015-09-29 16:21:35 +02:00
parent 2780e6f3d7
commit dc37d3bf62

View File

@@ -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];