From 83afebacc7f122924cb06c5a1b5092bb5b0606e6 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 12 Dec 2015 16:19:13 +0000 Subject: [PATCH] Init arrays to empty. Return empty array instead of null --- handler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handler.c b/handler.c index 43ba380..144434d 100644 --- a/handler.c +++ b/handler.c @@ -168,7 +168,7 @@ bool jsonserver_reclist(Json::Value& js) Log* log = Log::getInstance(); log->log("JSONServer", Log::DEBUG, "reclist"); - Json::Value jsrecordings; + Json::Value jsrecordings(Json::arrayValue); cRecordings Recordings; Recordings.Load(); for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) @@ -805,7 +805,7 @@ bool jsonserver_channellist(Json::Value& js) Log* log = Log::getInstance(); log->log("JSONServer", Log::DEBUG, "channellist"); - Json::Value jschannels; + Json::Value jschannels(Json::arrayValue); // int type; for (cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) @@ -889,7 +889,7 @@ bool jsonserver_channelschedule(Json::Value& js, const char* postData) return true; } - Json::Value jsevents; + Json::Value jsevents(Json::arrayValue); for (const cEvent* event = Schedule->Events()->First(); event; event = Schedule->Events()->Next(event)) { @@ -1017,7 +1017,7 @@ bool jsonserver_timerlist(Json::Value& js) Log* log = Log::getInstance(); log->log("JSONServer", Log::DEBUG, "timerlist"); - Json::Value jstimers; + Json::Value jstimers(Json::arrayValue); cTimer *timer; int numTimers = Timers.Count(); -- 2.39.2