1
0
forked from drath/libratbag

etekcity: make sure action is valid before dereferencing it

This should never happen on the Etekcity Scroll Alpha, but we might end
up in a situation where this is required.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2015-09-02 10:36:40 -04:00
parent 9ccaaa9ea9
commit 77035a08ae

View File

@@ -526,7 +526,7 @@ etekcity_read_profile(struct ratbag_profile *profile, unsigned int index)
struct etekcity_macro *macro;
action = etekcity_button_to_action(profile, i);
if (action->type != RATBAG_BUTTON_ACTION_TYPE_MACRO)
if (!action || action->type != RATBAG_BUTTON_ACTION_TYPE_MACRO)
continue;
etekcity_set_config_profile(device, index, i);