1
0
Fork 0

Fix crash when event listener not created

This commit is contained in:
Fred Sundvik 2016-05-17 11:21:38 +03:00
parent 15300cb681
commit 07e412c538

View file

@ -458,8 +458,10 @@ void visualizer_init(void) {
void update_status(bool changed) { void update_status(bool changed) {
if (changed) { if (changed) {
GSourceListener* listener = geventGetSourceListener(layer_changed_event, NULL); GSourceListener* listener = geventGetSourceListener(layer_changed_event, NULL);
if (listener) {
geventSendEvent(listener); geventSendEvent(listener);
} }
}
#ifdef USE_SERIAL_LINK #ifdef USE_SERIAL_LINK
static systime_t last_update = 0; static systime_t last_update = 0;
systime_t current_update = chVTGetSystemTimeX(); systime_t current_update = chVTGetSystemTimeX();