changeset 59:059341095e99

Apparently in MoP it is not possible for InstanceType in GetInstanceInfo() to return nil.
author James D. Callahan III <jcallahan@curse.com>
date Wed, 04 Jul 2012 16:01:11 -0500
parents 63f7286e5d13
children 3a6693c99bb3
files Main.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Main.lua	Tue Jul 03 20:25:17 2012 -0500
+++ b/Main.lua	Wed Jul 04 16:01:11 2012 -0500
@@ -125,9 +125,13 @@
 
 local function InstanceDifficultyToken()
     local _, instance_type, instance_difficulty, difficulty_name, _, _, is_dynamic = _G.GetInstanceInfo()
-    if difficulty_name == "" then
+    if not difficulty_name or difficulty_name == "" then
         difficulty_name = "NONE"
     end
+
+    if not instance_type or instance_type == "" then
+        instance_type = "NONE"
+    end
     return ("%s:%s:%s"):format(instance_type:upper(), difficulty_name:upper():gsub(" ", "_"), _G.tostring(is_dynamic))
 end