From 328cebc4f0ab6594094b021de0548e82ae90cf9c Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Tue, 28 Nov 2017 10:27:10 -0800 Subject: binding: gps: don't save null records in recording While waiting for GPS lock don't save 'null' entries. Bug-AGL: SPEC-1139 Change-Id: Iccac429c1ae024d2b26046558cb5ace9d4c85daf Signed-off-by: Matt Ranostay --- binding/afm-gps-binding.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'binding') 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); } -- cgit 1.2.3-korg