aboutsummaryrefslogtreecommitdiffstats
path: root/binding/afm-gps-binding.c
diff options
context:
space:
mode:
Diffstat (limited to 'binding/afm-gps-binding.c')
-rw-r--r--binding/afm-gps-binding.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/binding/afm-gps-binding.c b/binding/afm-gps-binding.c
index 90d9155..f2a48fd 100644
--- a/binding/afm-gps-binding.c
+++ b/binding/afm-gps-binding.c
@@ -270,11 +270,12 @@ static void *data_poll(void *ptr)
if (!(data.set & (TRACKERR_SET | SPEEDERR_SET| CLIMBERR_SET))) {
jresp = populate_json_data(json_object_new_object());
- if (recording.current_file != NULL)
- add_record(jresp);
+ if (jresp != NULL) {
+ if (recording.current_file != NULL)
+ add_record(jresp);
- if (jresp != NULL)
afb_event_push(location_event, jresp);
+ }
}
pthread_mutex_unlock(&mutex);
}