View Single Post
12/20/20, 03:51 PM   #18
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
I said: The table is missing, not the init of whatever.

This is where "GuildBankLedger.LibHistoireListener" is mentioned the 1st time:
Lua Code:
  1. function GuildBankLedger:SetupListener(guildID)
  2. ...
  3.   GuildBankLedger.LibHistoireListener[guildID] = LGH:CreateGuildHistoryListener(guildID, GUILD_HISTORY_BANK)
It is using the table "GuildBankLedger.LibHistoireListener" with the index "[guildID]".
But where is the table "GuildBankLedger.LibHistoireListener" defined?

At least not in the file which was attached (searched for GuildBankLedger.LibHistoireListener and self.LibHistoireListener and LibHistoireListener, and there is not any line with = {} or = function which would create that table).

So either add the table init line at the beginning of the file or inside the function itsself like this:
Lua Code:
  1. function GuildBankLedger:SetupListener(guildID)
  2. --LGH:RegisterCallback(LibHistoire.callback.INITIALIZED, function()
  3.   -- listener
  4.   d("Starting SetupListenerFunction " .. guildID)
  5.  
  6.   --This was missing: Create the table GuildBankLedger.LibHistoireListener ( = {}) or re-use it if it already exists
  7.   GuildBankLedger.LibHistoireListener = GuildBankLedger.LibHistoireListener or {}
  8.   GuildBankLedger.LibHistoireListener[guildID] = LGH:CreateGuildHistoryListener(guildID, GUILD_HISTORY_BANK)

Last edited by Baertram : 12/20/20 at 03:54 PM.
  Reply With Quote