Bagnon RequiredLevel

Bagnon RequiredLevel

127k Downloads

GetItemInfo() returning minItemLevel = nil

Comicus opened this issue ยท 2 comments

commented

Not sure what happened, just started getting this error:

22x Bagnon_RequiredLevel\main.lua:170: attempt to compare number with nil
Bagnon_RequiredLevel\main.lua:170: in function <Bagnon_RequiredLevel\main.lua:152>
[C]: ?

Locals:
self = ContainerFrame2Item30 {
0 =
bag = 3
BattlepayItemTexture = {
}
IconOverlay = {
}
BagStaticTop = {
}
Flash = {
}
IconBorder = {
}
newitemglowAnim = {
}
icon = ContainerFrame2Item30IconTexture {
}
ExtendedOverlay = {
}
caerdonButton = {
}
IconGlow = {
}
QuestBorder = ContainerFrame2Item30IconQuestTexture {
}
Cooldown = ContainerFrame2Item30Cooldown {
}
SplitStack = defined @FrameXML\ContainerFrame.lua:1086
CanIMogItOverlay = CIMIOverlayFrame_ContainerFrame2Item30 {
}
BagStaticBottom = {
}
flash = {
}
scheduledSecondaryUpdate = false
ExtendedSlot = {
}
ExtendedOverlay2 = {
}
hasItem = true
JunkIcon = {
}
flashAnim = {
}
timeSinceUpgradeCheck = 0
count = 1
readable = false
Count = ContainerFrame2Item30Count {
}
frame = BagnonFrameinventory {
}
info =

{
}
searchOverlay = ContainerFrame2Item30SearchOverlay {
}
NewItemTexture = {
}
UpgradeIcon = {
}
}
itemLink = "|cff0070dd|Hitem:157953::::::::120:255::25:2:1487:4785:::|h[Bilewing Helmet]|h|r"
RequiredLevel = {
0 =
}
_ = nil
_ = nil
_ = nil
_ = nil
itemMinLevel = nil
_ = nil
itemSubType = nil
_ = nil
_ = nil
_ = nil
_ = nil
itemTypeId = nil
(*temporary) = 120
(*temporary) = "player"
(*temporary) = 120
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to compare number with nil"
_G =
{
ContainerFrame5Item7 = ContainerFrame5Item7 {
}
DH_HAVOC_CORE_ABILITY_2 = "Strong melee attack that consumes Fury. If it critical strikes, some Fury is refunded."
AllTheThings-Enable All "No Chance"Text = AllTheThings-Enable All "No Chance"Text {
}
GetTrainerServiceTypeFilter = defined =[C]:-1
UNIT_NAMES_COMBATLOG_TOOLTIP = "Color unit names."
AchievementFrameStatsBG = AchievementFrameStatsBG {
}
SetTrainerServiceTypeFilter = defined =[C]:-1
LE_GAME_ERR_CHAT_RAID_RESTRICTED_TRIAL = 737
SPELL_FAILED_CUSTOM_ERROR_71 = "This partygoer wants to dance with you."
LE_GAME_ERR_PET_SPELL_TARGETS_DEAD = 398
BT4Button58 = BT4Button58 {
}
CompactUnitFrameProfilesGeneralOptionsFrameHealthTextDropdownButtonNormalTexture = CompactUnitFrameProfilesGeneralOptionsFrameHealthTextDropdownButtonNormalTexture {
}
PawnItemComparer = defined @Pawn\Pawn.lua:3464
LCO_watchFallingText = LCO_watchFallingText {
}
MultiBarLeftButton7 = MultiBarLeftButton7 {
}
WQT_TooltipTooltipTextLeft6 = WQT_TooltipTooltipTextLeft6 {
}
LibDugi_UIDropDownMenu_SetSelectedValue = defined @DugisGuideViewerZ\Libs\DropDownMenu\UIDropDownMenu.lua:733
SkilletRankFrameGray = SkilletRankFrameGray {
}
LFGListInviteDialog_OnEvent = defined @FrameXML\LFGList.lua:2378
MerchantItem5AltCurrencyFrameItem1Text = MerchantItem5AltCurrencyFrameItem1Text {
}
BINDING_NAME_NAMEPLATES = "Show Enemy Name Plates"
INSTANCE_UNAVAILABLE_OTHER_TEMPORARILY_DISABLED = "%s cannot enter. This instance is temporarily disabled."
MultiBarBottomRightButton8Shine5 = MultiBarBottomRightButton8Shine5 {
}
IsReferAFriendLinked = defined =[C]:-1
Overachiever_SearchFrameContainerButton1TabardBackground = Overachiever_SearchFrameContainerButton1TabardBackground {
}
UnitFrameManaBar_UnregisterDefaultEvents = defined @FrameXML\UnitFrame.lua:787
PaperDollTitlesPaneButton12BgTop = PaperDollTitlesPaneButton12BgTop {
}
ERR_NOAMMO_S = "%s"
BT4Button22Flash = BT4Button22Flash {
}
ClassOrderHallsCompleteUIMainFrameTab1SubFrameFooterAdvancementsReportButton = ClassOrderHallsCompleteUIMainFrameTab1SubFrameFooterAdvancementsReportButton {
}
HasZoneAbility = defined @FrameXML\ZoneAbility.lua:157
BOOST2_WARRIOR_COLOSSUSSMASH = "Use |cFFFFFFFFColossus Smash|r.

|cFFFFFFFFColossus Smash|r increases your damage."
LE_GAME_E

commented

Thanks for reporting this!

By your error message it looks like the function GetItemInfo() used on the item link of "Bilewing Helmet" does return nil as minItemLevel, which is really odd. As I don't have this item myself I cannot reproduce this. But I shall ask people of the community for ideas.

For the time being I am releasing a new version (1.2) catching this error. Thus, instead of an error message you will just see the item as unaltered by "Bagnon RequiredLevel". Please let me know if you come across other items that get omitted this way. It would be helpful to single out the error.

commented

OK, I got some help from the excellent people at wowinterface.com. So it seems that my fix of catching the return value of nil was already the solution. You should not see any unaltered icons as I suspected in my previous post because Bagnon should trigger an update whenever the GET_ITEM_INFO_RECEIVED event is received. Otherwise, let me know!