Commit 32284b89 authored by Jacob Priddy's avatar Jacob Priddy 👌

fix all instances of calling a null pointer

parent e3535db2
Pipeline #12552 passed with stages
in 1 minute and 38 seconds
......@@ -72,9 +72,8 @@ static void release_all_keys(void)
while (tmp)
{
door_keypad_callback_t* cb = (door_keypad_callback_t*)tmp->data;
if (cb->on_release) {
if (cb->on_release)
cb->on_release(keypad_map[row][col]);
}
tmp = tmp->next;
}
END_PROTECT_CALLBACKS_LIST;
......@@ -121,7 +120,8 @@ static void handle_key_presses(void)
while (tmp)
{
door_keypad_callback_t* cb = (door_keypad_callback_t*)tmp->data;
cb->on_press(keypad_map[row][col]);
if (cb->on_press)
cb->on_press(keypad_map[row][col]);
tmp = tmp->next;
}
END_PROTECT_CALLBACKS_LIST;
......@@ -136,7 +136,8 @@ static void handle_key_presses(void)
while (tmp)
{
door_keypad_callback_t* cb = (door_keypad_callback_t*)tmp->data;
cb->on_release(keypad_map[row][col]);
if (cb->on_release)
cb->on_release(keypad_map[row][col]);
tmp = tmp->next;
}
END_PROTECT_CALLBACKS_LIST;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment