summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--binding/afm-geoclue-binding.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/binding/afm-geoclue-binding.c b/binding/afm-geoclue-binding.c
index 07b19e1..7aef809 100644
--- a/binding/afm-geoclue-binding.c
+++ b/binding/afm-geoclue-binding.c
@@ -101,14 +101,13 @@ static void send_event(GClueSimple *simple)
static void get_data(afb_req_t request)
{
- json_object *jresp = json_object_new_object();
- GClueLocation *location;
-
if (simple == NULL) {
afb_req_fail(request, "failed", "No GeoClue instance available");
return;
}
+ json_object *jresp = json_object_new_object();
+ GClueLocation *location;
location = gclue_simple_get_location(simple);
populate_json(jresp, location);