From afdae86a5e9c5ed7d2e6a037739d177f08d74477 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sun, 12 Feb 2017 06:04:22 +0100
Subject: [PATCH] gluon-respondd: allow platforminfo_get_model() to return NULL

---
 package/gluon-respondd/src/respondd.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/gluon-respondd/src/respondd.c b/package/gluon-respondd/src/respondd.c
index 2b7a18f93..bb54f382e 100644
--- a/package/gluon-respondd/src/respondd.c
+++ b/package/gluon-respondd/src/respondd.c
@@ -99,7 +99,11 @@ static struct json_object * respondd_provider_nodeinfo(void) {
 	json_object_object_add(ret, "hostname", get_hostname());
 
 	struct json_object *hardware = json_object_new_object();
-	json_object_object_add(hardware, "model", json_object_new_string(platforminfo_get_model()));
+
+	const char *model = platforminfo_get_model();
+	if (model)
+		json_object_object_add(hardware, "model", json_object_new_string(model));
+
 	json_object_object_add(hardware, "nproc", json_object_new_int(sysconf(_SC_NPROCESSORS_ONLN)));
 	json_object_object_add(ret, "hardware", hardware);
 
-- 
GitLab