add: logging and NULL-check
This commit is contained in:
parent
6ab71ca316
commit
7fa462ef1d
3 changed files with 10 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.7)
|
||||
project(core
|
||||
VERSION 0.2.10
|
||||
VERSION 0.2.11
|
||||
LANGUAGES C)
|
||||
|
||||
add_executable(core src/main.c)
|
||||
|
|
|
@ -170,8 +170,11 @@ cache_invalidate_relay(int relay_id)
|
|||
cache_invalidate(key);
|
||||
|
||||
relay_t *relay = relay_get_by_id(relay_id);
|
||||
cache_invalidate_controller(relay->controller_id);
|
||||
relay_free(relay);
|
||||
if(relay)
|
||||
{
|
||||
cache_invalidate_controller(relay->controller_id);
|
||||
relay_free(relay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -157,8 +157,11 @@ relay_save(relay_t *relay)
|
|||
}
|
||||
}
|
||||
|
||||
LOGGER_DEBUG("rebuilding relay_schedule junction\n");
|
||||
|
||||
LOGGER_DEBUG("cleaning relay_schedule junction\n");
|
||||
junction_relay_schedule_remove_for_relay(relay->id);
|
||||
|
||||
LOGGER_DEBUG("rebuilding relay_schedule junction\n");
|
||||
for(int i = 0; i < 7; ++i)
|
||||
{
|
||||
junction_relay_schedule_insert(i, relay->id, relay->schedules[i]->id);
|
||||
|
|
Loading…
Reference in a new issue