From fee10f117a3a179c692032c0130e3d7f6dd96573 Mon Sep 17 00:00:00 2001 From: atom0s Date: Thu, 27 Apr 2017 16:09:33 -0700 Subject: [PATCH] Fixed crash issue when no callid is given. --- changecall.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/changecall.lua b/changecall.lua index 8eab82b..8466dcb 100644 --- a/changecall.lua +++ b/changecall.lua @@ -25,7 +25,7 @@ _addon.author = 'atom0s'; _addon.name = 'ChangeCall'; -_addon.version = '1.0.0'; +_addon.version = '1.0.1'; require 'common' @@ -47,7 +47,12 @@ ashita.register_event('command', function(command, ntype) end -- Pull the new call id to use.. - settings.callid = tonumber(string.gsub(command, '/changecall', ''):trim()); + local callid = string.gsub(command, '/changecall', ''):trim(); + if (callid == nil or string.len(callid) == 0) then + settings.callid = 0; + else + settings.callid = tonumber(callid); + end local newid = ''; if (settings.callid > 0) then