# HG changeset patch # User MMOSimca # Date 1425117689 18000 # Node ID a4256abd13b750d77a3d1aaefa098afdc27588ad # Parent 2baf8d90d8a8ab5f61f45ac390130ed5fee51424 Added a conditional check to protect against collecting instance information when not in an instance. diff -r 2baf8d90d8a8 -r a4256abd13b7 Main.lua --- a/Main.lua Fri Feb 27 07:40:07 2015 -0500 +++ b/Main.lua Sat Feb 28 05:01:29 2015 -0500 @@ -350,12 +350,16 @@ local function InstanceDifficultyToken() - local _, instance_type, instance_difficulty, _, _, _, is_dynamic = _G.GetInstanceInfo() - - if not instance_type or instance_type == "" then - instance_type = "NONE" + -- Sometimes, instance information is returned when not in an instance. This check protects against that. + if _G.IsInInstance() then + local _, instance_type, instance_difficulty, _, _, _, is_dynamic = _G.GetInstanceInfo() + + if not instance_type or instance_type == "" then + instance_type = "NONE" + end + return ("%s:%d:%s"):format(instance_type:upper(), instance_difficulty, tostring(is_dynamic)) end - return ("%s:%d:%s"):format(instance_type:upper(), instance_difficulty, tostring(is_dynamic)) + return "NONE:0:false" end