Grid2

Grid2

9M Downloads

Error at Grid2Options/modules/statuses/StatusRange.lua:7 (found in Classic SOD)

AlexFolland opened this issue ยท 4 comments

commented

When logging in to Classic SOD for the first time with the latest Grid2 for Classic WoW and my settings, I got the following error.

error from BugSack (click to expand)
45x Grid2Options/modules/statuses/StatusRange.lua:7: attempt to index a nil value
[string "@Grid2Options/modules/statuses/StatusRange.lua"]:7: in main chunk

Locals:
L = <table> {
 Action = "Action"
 About = "About"
 Show Minimap Icon = "Show Minimap Icon"
 role = "role"
 Player has been summoned, waiting for a response. = "Player has been summoned, waiting for a response."
 Raid = "Raid"
 Raid (Other) = "Raid (Other)"
 Portrait Type = "Portrait Type"
 layout = "layout"
 Are you sure you want to delete the selected profile? = "Are you sure you want to delete the selected profile?"
 LEFT = "LEFT"
 Sets the duration in seconds. = "Sets the duration in seconds."
 Mana&Power = "Mana&Power"
 Y - Vertical Offset = "Y - Vertical Offset"
 Delete last status = "Delete last status"
 Buffs: Defensive Cooldowns = "Buffs: Defensive Cooldowns"
 Adjust the horizontal offset of the text = "Adjust the horizontal offset of the text"
 |cFFe0e000
These options are applied to the active theme, if you want to change the settings for another theme go to the Appearance tab inside the Themes section. = "|cFFe0e000
These options are applied to the active theme, if you want to change the settings for another theme go to the Appearance tab inside the Themes section."
 Detach Header = "Detach Header"
 Select one of your currently available profiles. = "Select one of your currently available profiles."
 Move the status higher in priority = "Move the status higher in priority"
 raid = "raid"
 Size = "Size"
 Select how many colors the status must provide. = "Select how many colors the status must provide."
 Display a zero index for player unit while in party or raid. = "Display a zero index for player unit while in party or raid."
 alpha = "alpha"
 Threshold = "Threshold"
 Font = "Font"
 Default difficulty for Encounter Journal links = "Default difficulty for Encounter Journal links"
 General Settings = "General Settings"
 X Offset = "X Offset"
 Clean Current Profile = "Clean Current Profile"
 Stack Text = "Stack Text"
 Select the health update frequency. = "Select the health update frequency."
 rangealt = "rangealt"
 Mouse Leave Delay = "Mouse Leave Delay"
 Debuffs: Healing Prevented  = "Debuffs: Healing Prevented "
 MA = "MA"
 Last Aura = "Last Aura"
 HORIZONTAL = "HORIZONTAL"
 New Buff = "New Buff"
 Unit Tooltips = "Unit Tooltips"
 WARLOCK = "Warlock"
 text-up = "text-up"
 NONE = "NONE"
 Show heal targets even if they overlap with other heals. = "Show heal targets even if they overlap with other heals."
 Low value color = "Low value color"
 Enable this option to display the default unit tooltip when Out of Combat. = "Enable this option to display the default unit tooltip when Out of Combat."
 BOTTOMRIGHT = "BOTTOMRIGHT"
 Examples:
%p
%p percent = "Examples:
%p
%p percent"
 Spell Range = "Spell Range"
 display damage absorb shields above max hp = "display damage absorb shields above max hp"
 Create a new Buff. = "Create a new Buff."
 Current Profile = "Current Profile"
 Layout Look&Feel = "Layout Look&Feel"
 Enable or disable the background texture = "Enable or disable the background texture"
 Runic Power = "Runic Power"
 Paste here a profile in text format = "Paste here a profile in text format"
 Enable support for multiple themes, allowing to define different visual styles for the Grid2 frames. General options will change and a new Themes section will be displayed. = "Enable support for multiple themes, allowing to define different visual styles for the Grid2 frames. General options will change and a new Themes section will be displayed."
 Color %d = "Color %d"
 Minutes Format = "Minutes Format"
 Select where to anchor the bar and optional you can reverse the grow direction. = "Select where to anchor the bar and optional you can reverse the grow direction."
 Display status for units out of range. = "Display status for units out of range."
 Select the portrait to display. = "Select the portrait to display."
 Enable this option to display the target of focus unit. = "Enable this option to display the target of focus unit."
 MainTank = "MainTank"
 Select the frame background texture. = "Select the frame background texture."
 Value Track = "Value Track"
 Units List = "Units List"
 Load the status only for the spec

I found that I could fix it locally by adding the following nil check before line 7 of that file:

if not Grid2:GetStatusByName('range') then return end

I'm not sure what triggers this or if others have seen it, but with my local hacky fix, everything seems to work just fine, including the range status, which is assigned to my alpha indicator.

I would paste the content of my SavedVariables/Grid2.lua file, but it is 79925 lines long. If you'd like it for figuring this out, please let me know and I'll arrange making it available.

commented

I brought my Grid2 settings from Classic WoW, which I have continuously brought over to every version of WoW since I initially configured Grid2 in MoP. It has always worked well due to your expert diligence in updates. I have maintained my settings for more than 10 years, continuously tweaking them to meet my needs. If there were any errors, I made sure to check the git history, check the code, and I've manually modified the saved tables in SavedVariables/Grid2.lua at least once to maintain compatibility, probably back around WoD or Legion.

That all being said, I understand and agree that the error should never happen because the range status is always created by Grid2 which should be loaded first. I wonder if something is triggering the load of Grid2Options earlier than that, but I'm not sure what it could be as of writing this paragraph.

However, as of writing this paragraph, I've discovered that FriendXP has Grid2Options as an optional dependency, which is causing Grid2Options to load earlier than Grid2. I use FriendXP to display my friends' XP in my Grid2 frames, which is fun while leveling together. This is what is triggering Grid2Options to load early. I have indeed tested this without my nil-check hack, and the result is that when FriendXP is enabled, the error is logged, and when FriendXP is disabled, the error is not logged. My nil-check hack prevents the error.

I personally think Grid2 should not break if Grid2Options loads early. Somehow this combination of FriendXP and Grid2 has not caused this error over the years, and only now after having been away from the game for about a year have I seen this.

Thanks for your well-considered response, and I'm looking forward to your analysis.

commented

Thank you for the fix! To test it, I overwrote the files in which changes were made since the last release of Grid2 into my local Grid2 and Grid2Options directories and entered the game with FriendXP enabled. There were no errors upon entering the game world, which resolves this issue.

commented

You can update version 2.7.9-beta.

commented

Is the error happening just when you log in or when you type /Grid2 or use the minimap icon to open the configuration ?
I dont understand your comment about failing only "for the first time" ? on first login there is no grid2 settings, a default profile is created.

This error should never happen, because "range" status is always created by grid2, and grid2options addon is always loaded after grid2 (when the user clicks on the minimap or using the chat command and at this point grid2 is already fully loaded and initialized).

If grid2option addon is loaded before grid2 initialization this means that some macro, another addon or a weak aura is loading the grid2option addon on login (and this should never happen, i dont know why someone should need to load the configuration options so early, on login).

You can export your profile to text format in General/Profiles/Import&Export tab.