From 62b420d07b5ff13ab587d805a64ce44f93e6c83f Mon Sep 17 00:00:00 2001 From: shagu Date: Fri, 23 Jul 2021 17:43:28 +0200 Subject: [PATCH] libpredict: check msg variable before using it --- libs/libpredict.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 2272ef50..0481dc89 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -66,10 +66,11 @@ function libpredict:ParseComm(sender, msg) msgtype = "Stop" elseif msg == "Resurrection/stop/" then msgtype = "RessStop" - else + elseif msg then local msgobj = {strsplit("/", msg)} - if msgobj and msgobj[1] and msgobj[2] then -- legacy healcomm object + if msgobj and msgobj[1] and msgobj[2] then + -- legacy healcomm object if msgobj[1] == "GrpHealdelay" or msgobj[1] == "Healdelay" then msgtype, time = "Delay", msgobj[2] end @@ -88,7 +89,8 @@ function libpredict:ParseComm(sender, msg) if msgobj[i] then table.insert(target, msgobj[i]) end end end - elseif select and UnitCastingInfo then -- latest healcomm + elseif select and UnitCastingInfo then + -- latest healcomm msgtype = tonumber(string.sub(msg, 1, 3)) if not msgtype then return end