]> git.vomp.tv Git - jsonserver.git/commitdiff
Init arrays to empty. Return empty array instead of null
authorChris Tallon <chris@vomp.tv>
Sat, 12 Dec 2015 16:19:13 +0000 (16:19 +0000)
committerChris Tallon <chris@vomp.tv>
Sat, 12 Dec 2015 16:19:13 +0000 (16:19 +0000)
handler.c

index 43ba3808faef4123d03214f56d921f99c68b8e8d..144434d9848e16fe4d268fd73a2bedd7a525e144 100644 (file)
--- 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();