From 4b9eae11d98d39b0a5d14587dc678f4224777573 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 1 Sep 2015 16:09:26 -0400 Subject: [PATCH] tools: cmd_info: if there is no profile, it's a bug... ...but we should not go further Signed-off-by: Benjamin Tissoires --- tools/ratbag-command.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/ratbag-command.c b/tools/ratbag-command.c index 9952ef08..aa1e3215 100644 --- a/tools/ratbag-command.c +++ b/tools/ratbag-command.c @@ -320,6 +320,8 @@ ratbag_cmd_info(struct ratbag *ratbag, uint32_t flags, int argc, char **argv) for (i = 0; i < num_profiles; i++) { int dpi, rate; profile = ratbag_device_get_profile_by_index(device, i); + if (!profile) + continue; printf(" Profile %d%s\n", i, ratbag_profile_is_active(profile) ? " (active)" : "");