From 85ca5a9522cac59fcf8722bd5cedc3a8487bfb0f Mon Sep 17 00:00:00 2001 From: "Johnny C. Lam" Date: Mon, 21 Apr 2014 05:02:14 +0000 Subject: [PATCH] Sanity-check a table variable before using it. git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1302 d5049fe3-3747-40f7-a4b5-f36d6801af5f --- OvaleState.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/OvaleState.lua b/OvaleState.lua index 59c5bea..57f83c1 100644 --- a/OvaleState.lua +++ b/OvaleState.lua @@ -1,7 +1,7 @@ --[[-------------------------------------------------------------------- Ovale Spell Priority Copyright (C) 2012 Sidoine - Copyright (C) 2012, 2013 Johnny C. Lam + Copyright (C) 2012, 2013, 2014 Johnny C. Lam This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License in the LICENSE @@ -68,8 +68,10 @@ function OvaleState:UnregisterState(stateAddon) -- Remove mix-in methods from addon's state prototype. local statePrototype = self.statePrototype[stateAddon] - for k in pairs(statePrototype) do - self.state[k] = nil + if statePrototype then + for k in pairs(statePrototype) do + self.state[k] = nil + end end self.statePrototype[stateAddon] = nil end -- 1.7.9.5