Additional null check in video_driver.c

I have managed to trigger a null pointer exception on one of these two functions, so for safety, I added in null checks for the structs and function pointers.
This commit is contained in:
Dwedit 2018-05-09 19:25:33 -05:00
parent 911072fb69
commit bafb23edc3

View File

@ -564,12 +564,12 @@ const video_poke_interface_t *video_driver_get_poke(void)
static bool video_context_has_focus(void)
{
return current_video_context.has_focus(video_context_data);
return current_video_context.has_focus && current_video_context.has_focus(video_context_data);
}
static bool video_driver_has_focus(void)
{
return current_video->focus(video_driver_data);
return current_video && current_video->focus && current_video->focus(video_driver_data);
}
static bool null_driver_has_focus(void)