Thaoky / Altoholic_Retail

WoW Altoholic Addon (WoW Retail version)
23 stars 5 forks source link

(fix included) DataStore_Crafts/DataStore_Crafts_Retail.lua:266: attempt to index local 'profession' (a nil value) #28

Open R-Adrian opened 1 month ago

R-Adrian commented 1 month ago

In Pandaria Remix... there are actually hidden profession trainers in Siege of Orgrimmar, so, on a solo run, i managed to learn Mining and Blacksmithing as professions from the Orgrimmar trainers... (on a Horde alt, of course) but when i open the profession interface then Altoholic's Datastore shows this error:

image

3x DataStore_Crafts/DataStore_Crafts_Retail.lua:266: attempt to index local 'profession' (a nil value)
[string "@DataStore_Crafts/DataStore_Crafts_Retail.lua"]:266: in function <DataStore_Crafts/DataStore_Crafts_Retail.lua:264>
[string "@DataStore_Crafts/DataStore_Crafts_Retail.lua"]:317: in function <DataStore_Crafts/DataStore_Crafts_Retail.lua:303>
[string "@DataStore_Crafts/DataStore_Crafts_Retail.lua"]:506: in function `callback'
[string "@DataStore/Events/Addon.lua"]:17: in function <DataStore/Events/Addon.lua:13>

Locals:
profession = nil
professionIndex = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index local 'profession' (a nil value)"
C_TradeSkillUI = <table> {
}
recipeCategoriesDB = <table> {
 255 = "Gloves"
 256 = "Belts"
 257 = "Pants"
 1027 = "Scopes & Ammo"
 1029 = "Kul Tiran Herbalism"
 1030 = "Gathering Techniques"
 1032 = "Gathering Techniques"
 1034 = "Draenor Herbalism"
 1036 = "Pandaria Herbalism"
 1038 = "Cataclysm Herbalism"
 1040 = "Northrend Herbalism"
 1042 = "Outland Herbalism"
 1044 = "Herbalism"
 1046 = "Zandalari Skinning"
 1050 = "Draenor Skinning"
 1052 = "Pandaria Skinning"
 1054 = "Cataclysm Skinning"
 1056 = "Northrend Skinning"
 265 = "Elemental"
 1060 = "Skinning"
 1061 = "Skinning Techniques"
 1062 = "Skinning Techniques"
 1065 = "Kul Tiran Mining"
 1068 = "Draenor Mining"
 1070 = "Pandaria Mining"
 1072 = "Cataclysm Mining"
 1074 = "Northrend Mining"
 1076 = "Outland Mining"
 1078 = "Mining"
 1079 = "Mining Techniques"
 1080 = "Mining Techniques"
 1081 = "Smelting"
 1082 = "Smelting"
 1083 = "Smelting"
 1084 = "Smelting"
 1085 = "Mount Equipment"
 1086 = "Bandages"
 1087 = "Cures of Draenor"
 1088 = "Cures of the Broken Isles"
 1089 = "Bandages"
 1090 = "Bandages"
 1091 = "Bandages"
 1092 = "Bandages"
 547 = "Armor"
 548 = "Weapons"
 1096 = "Belt Attachments"
 549 = "Other"
 550 = "Tool of the Trade"
 1100 = "Fishing"
 1102 = "Outland Fishing"
 1104 = "Northrend Fishing"
 553 = "Pandaren Plans"
 1106 = "Cataclysm Fishing"
 554 = "Helms"
 1108 = "Pandaria Fishing"
 555 = "Shoulders"
 1110 = "Draenor Fishing"
 556 = "Materials"
 1112 = "Legion Fishing"
 557 = "Equipment Mods"
 1114 = "Zandalari Fishing"
 1115 = "Cloth Goggles"
 1116 = "Embroidery"
 559 = "Chest"
 560 = "Gauntlets"
 561 = "Bracers"
 1123 = "Cures & Tonics"
 1124 = "Anti-Venoms"
 563 = "Legs"
 564 = "Boots"
 565 = "Shields"
 566 = "Weapons"
 567 = "Skeleton Keys"
 569 = "Cataclysm Plans"
 570 = "Armor"
 571 = "Weapons"
 572 = "Materials"
 573 = "Shields"
 574 = "Equipment Mods"
 575 = "Skeleton Keys"
 577 = "Northrend Plans"
 578 = "Equipment Mods"
 579 = "Armor"
 580 = "Shields"
 581 = "Weapons"
 582 = "Skeleton Keys"
 584 = "Outland Plans"
 585 = "Equipment Mods"
 586 = "Armor"
 588 = "Weapons"
 590 = "Blacksmithing Plans"
 592 = "Kul Tiran Alchemy"
 596 = "Pandaria Alchemy"
 598 = "Cataclysm Alchemy"
 600 = "Northrend Alchemy"
 602 = "Outland Alchemy"
 604 = "Alchemy"
 605 = "Combat Potions"
 606 = "Utility Potions"
 607 = "Flasks"
 608 = "Transmutation"
 609 = "Trinkets"
 610 = "Tool of the Trade"
 611 = "Potions"
 612 = "Elixirs"
 613 = "Flasks"
 614 = "Transmutation"
 1228 = "Cauldrons"
 615 = "Trinkets"
 1230 = "Follower Equipment"
 1231 = "Follower Equipment"
 617 = "Cauldrons"
 1234 = "Follower Equipment"
 618 = "Potions"
 1236 = "Follower Equipment"
 619 = "Elixirs"
 1238 = "Conversions"
 1239 = "Conversions"
 1241 = "Conversions"
 622 = "Trinkets"
 1244 = "Conversions"
 1245 = "Conversions"
 1246 = "Leather Goggles"
 1247 = "Mail Goggles"
 1248 = "Plate Goggles"
 625 = "Research"
 1250 = "Training"
 626 = "Potions"
 627 = "Elixirs"
 1254 = "Tool of the Trade"
 628 = "Flasks"
 629 = "Transmutation"
 630 = "Trinkets"
 631 = "Oils"
 632 = "Cauldrons"
 633 = "Potions"
 1266 = "Tool of the Trade"
 634 = "Elixirs"
 635 = "Flasks"
 636 = "Transmutation"
 637 = "Trinkets"
 638 = "Potions"
 639 = "Elixirs"
 640 = "Flasks"
 641 = "Transmutation"
 642 = "Trinkets"
 643 = "Oils"
 644 = "Materials"
 1288 = "Mount Equipment"
 1289 = "Mounts Equipment"
 1294 = "Shadowlands Alchemy"
 1295 = "Cauldrons"
 1296 = "Combat Potions"
 1297 = "Oils and Extracts"
 1298 = "Flasks"
 1299 = "Optional Reagents"
 1300 = "Transmutation"
 1301 = "Trinkets"
 1302 = "Utility Potions"
 1303 = "Anti-Venoms"
 1304 = "Focus"
 1
R-Adrian commented 1 month ago

quick fix added at line 316: if not profession then return end

Tequima commented 1 month ago

Happens with other actions too, like opening the profession tab when filtered on a profession and clicking on a toon's Engineering icon: image

Tequima commented 1 month ago

quick fix added at line 316: if not profession then return end

Hi, thank you for the fix. However Notepad doesn't come with line numbers. Could you please give the context, a term we can search for, to add the line in?

R-Adrian commented 1 month ago
    if not tradeskillName or tradeskillName == "UNKNOWN" or info.professionID == 960 or C_TradeSkillUI.IsNPCCrafting() then return end  

    local char = thisCharacter
    local professionIndex = char.Indices[tradeskillName]
    local profession = char.Professions[professionIndex]
    if not profession then return end
        ScanRecipeCategories(profession, professionIndex)
    if profession.Cooldowns then
        wipe(profession.Cooldowns)
    end 

image

Tequima commented 4 weeks ago

Thank you for this. btw I found from a post in either ATT or TSM Discord that Blizzard curtails add-on processing when in an Instance. (I was following up a separate issue of frequent disconnects when opening the mail or scanning the Auction House at the time. The workaround was to exit the garrison on first logging in and opening up my bags.). As the garrison is an instance it might explain the "extreme lag" part that triggered the issue?