Quantcast

Fix infinite loop introduced in r1083 when scanning pet spellbooks.

Johnny C. Lam [10-19-13 - 17:27]
Fix infinite loop introduced in r1083 when scanning pet spellbooks.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1085 d5049fe3-3747-40f7-a4b5-f36d6801af5f
Filename
OvaleSpellBook.lua
diff --git a/OvaleSpellBook.lua b/OvaleSpellBook.lua
index d89914b..d5c351f 100644
--- a/OvaleSpellBook.lua
+++ b/OvaleSpellBook.lua
@@ -173,7 +173,8 @@ function OvaleSpellBook:UpdatePetSpells()
 		local i = 1
 		while true do
 			local skillType, spellId = API_GetSpellBookItemInfo(i, BOOKTYPE_PET)
-			if spellId and skillType ~= "FUTURESPELL" and skillType ~= "FLYOUT" then
+			if not spellId then break end
+			if skillType ~= "FUTURESPELL" and skillType ~= "FLYOUT" then
 				-- Use GetSpellLink() in case this spellbook item was replaced by another spell.
 				local spellLink = API_GetSpellLink(i, BOOKTYPE_PET)
 				if spellLink then