summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Sundvik <fsundvik@gmail.com>2016-05-17 11:21:38 +0300
committerFred Sundvik <fsundvik@gmail.com>2016-05-17 11:21:38 +0300
commit07e412c53829c66e948eb147873a04cd27b0771b (patch)
treeae4fe1f98f866e2eb58324eb7e6c5fa2d4394752
parent15300cb681f74672547aa5e53d165ac748d43a17 (diff)
Fix crash when event listener not created
-rw-r--r--visualizer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/visualizer.c b/visualizer.c
index ea84546fb6..ff99e960fd 100644
--- a/visualizer.c
+++ b/visualizer.c
@@ -458,7 +458,9 @@ void visualizer_init(void) {
void update_status(bool changed) {
if (changed) {
GSourceListener* listener = geventGetSourceListener(layer_changed_event, NULL);
- geventSendEvent(listener);
+ if (listener) {
+ geventSendEvent(listener);
+ }
}
#ifdef USE_SERIAL_LINK
static systime_t last_update = 0;