(Driver) - Only push camera/location driver disabled message if first condition

fails
- Add further runtime check - checking if driver->start is bound
This commit is contained in:
twinaphex 2014-05-26 20:49:06 +02:00
parent 40f7e80745
commit f106a1cfaa
2 changed files with 6 additions and 6 deletions

View File

@ -76,12 +76,12 @@ void find_next_camera_driver(void)
bool driver_camera_start(void)
{
if (driver.camera && driver.camera_data)
if (driver.camera && driver.camera_data && driver.camera->start)
{
if (g_settings.camera.allow)
return driver.camera->start(driver.camera_data);
msg_queue_push(g_extern.msg_queue, "Camera is explicitly disabled.\n", 1, 180);
else
msg_queue_push(g_extern.msg_queue, "Camera is explicitly disabled.\n", 1, 180);
return false;
}
else

View File

@ -70,12 +70,12 @@ void find_next_location_driver(void)
bool driver_location_start(void)
{
if (driver.location && driver.location_data)
if (driver.location && driver.location_data && driver.location->start)
{
if (g_settings.location.allow)
return driver.location->start(driver.location_data);
msg_queue_push(g_extern.msg_queue, "Location is explicitly disabled.\n", 1, 180);
else
msg_queue_push(g_extern.msg_queue, "Location is explicitly disabled.\n", 1, 180);
return false;
}
else