diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-11-28 10:27:10 -0800 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-11-28 10:27:45 -0800 |
commit | 328cebc4f0ab6594094b021de0548e82ae90cf9c (patch) | |
tree | c2b7e966d8bf99b3ad68ffacc5f5631079d93aaf /binding/afm-gps-binding.c | |
parent | c594f767d6be434b7cdd09468e4736574aa77415 (diff) |
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 <matt.ranostay@konsulko.com>
Diffstat (limited to 'binding/afm-gps-binding.c')
-rw-r--r-- | binding/afm-gps-binding.c | 7 |
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); } |