From 6356cc7d447f58a6ced07bcb2565f9e83a375e37 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 26 Jul 2024 19:38:21 -0700 Subject: [PATCH] fix: #2185 handle nil spellIDs when collecting unlearned talents --- .../Core/Conditions/Categories/Talents.lua | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Components/Core/Conditions/Categories/Talents.lua b/Components/Core/Conditions/Categories/Talents.lua index f7ad6f69..593b0828 100644 --- a/Components/Core/Conditions/Categories/Talents.lua +++ b/Components/Core/Conditions/Categories/Talents.lua @@ -429,18 +429,17 @@ if C_ClassTalents then local definitionInfo = C_Traits.GetDefinitionInfo(entryInfo.definitionID) local spellID = definitionInfo.spellID - if spellID - -- The ranks are stored on the node, but we - -- have to make sure that we're looking at the ranks for the - -- currently selected entry for the talent. - and nodeInfo.activeEntry - and nodeInfo.activeEntry.entryID == entryID - then - map[spellID] = nodeInfo.ranksPurchased or 0 - elseif not map[spellID] then - -- Always populate unlearned talents if there's no entry for them - -- so that the suggestion list contains unlearned choice nodes. - map[spellID] = 0 + if spellID then + -- The ranks are stored on the node, but we + -- have to make sure that we're looking at the ranks for the + -- currently selected entry for the talent. + if nodeInfo.activeEntry and nodeInfo.activeEntry.entryID == entryID then + map[spellID] = nodeInfo.ranksPurchased or 0 + elseif not map[spellID] then + -- Always populate unlearned talents if there's no entry for them + -- so that the suggestion list contains unlearned choice nodes. + map[spellID] = 0 + end end end end