Quantcast

Stop the widget when the unit doesn't exist

Scott Sibley [11-01-10 - 06:45]
Stop the widget when the unit doesn't exist
Filename
Modules/Border/Border.lua
diff --git a/Modules/Border/Border.lua b/Modules/Border/Border.lua
index 8fe40b3..ef7b812 100644
--- a/Modules/Border/Border.lua
+++ b/Modules/Border/Border.lua
@@ -19,10 +19,12 @@ local defaults = {
 				name = "Border",
 				enabled = true,
 				expression = [[
-
+if not UnitExists(unit) then self:Stop(); return self.oldr, self.oldg, self.oldb end
 if UnitIsPlayer(unit) then
+	self.oldr, self.oldb, self.oldg = ClassColor(unit)
     return ClassColor(unit)
 else
+	self.oldr, self.oldb, self.oldg = UnitSelectionColor(unit)
     return UnitSelectionColor(unit)
 end
 ]],