From 1ff1867560c579332badb60971a3648d75c612d1 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 4 Aug 2014 16:27:18 +0200 Subject: [PATCH] MT#8243 add tostring() to sr.log on possible nil results --- ngcp/dlgcnt.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ngcp/dlgcnt.lua b/ngcp/dlgcnt.lua index 070858c..da9e5a5 100644 --- a/ngcp/dlgcnt.lua +++ b/ngcp/dlgcnt.lua @@ -79,12 +79,12 @@ end self.central = self._connect(self.config.central); end local res = self.central:incr(key); - sr.log("dbg", string.format("central:incr[%s]=>%s\n", key, res)); + sr.log("dbg", string.format("central:incr[%s]=>%s\n", key, tostring(res))); if not self._test_connection(self.pair) then self.pair = self._connect(self.config.pair); end local pos = self.pair:lpush(callid, key); - sr.log("dbg", string.format("pair:lpush[%s]=>[%s] %s\n", callid, key, pos)); + sr.log("dbg", string.format("pair:lpush[%s]=>[%s] %s\n", callid, key, tostring(pos))); end function NGCPDlgCounters:del_key(callid, key) @@ -97,7 +97,7 @@ end self.central = self._connect(self.config.central); end local res = self.central:decr(key); - sr.log("dbg", string.format("central:decr[%s]=>[%s]\n", key, res)); + sr.log("dbg", string.format("central:decr[%s]=>[%s]\n", key, tostring(res))); end function NGCPDlgCounters:del(callid) @@ -114,7 +114,7 @@ end local res; while key do res = self.central:decr(key); - sr.log("dbg", string.format("central:decr[%s]=>[%s]\n", key, res)); + sr.log("dbg", string.format("central:decr[%s]=>[%s]\n", key, tostring(res))); sr.log("dbg", string.format("pair:lpop[%s]=>[%s]\n", callid, key)); key = self.pair:lpop(callid); end @@ -125,7 +125,7 @@ end self.central = self._connect(self.config.central); end local res = self.central:get(key); - sr.log("dbg", string.format("central:get[%s]=>%s\n", key, res)); + sr.log("dbg", string.format("central:get[%s]=>%s\n", key, tostring(res))); return res; end -- class