View Single Post
07-06-19, 02:45 AM   #1
Aeriez
A Fallenroot Satyr
Join Date: May 2007
Posts: 24
GetItemInfo hanging?

I'm looping through a SavedVariable storing loot history. Printing line by line with a link to the item within the line. However, when create a SavedVariable with a 100 item history, when I load the game it will do one of them and then error out saying that the variable is nil, expecting value. But it's only once. So basically every time I reload the UI, it'll add one more item successfully to the list until I have the entire list printed out. Then it will no longer error out. Almost as if GetItemInfo is not able to keep up with the loop.

Lua Code:
  1. for i=1, #DKP_Log do
  2.     local itemToLink = select(2,GetItemInfo(DKP_Log[i]["loot"])) -- log holds Item ID
  3.  
  4.     .... write variable to fontstring ....
  5. end

error received: Interface\AddOns\DKP\ConfigMenuTabs.lua:546: attempt to concatenate local 'itemToLink' (a nil value)

Just seems really strange that once all items have been loaded, it's fine until the game is restarted. Is there a way to delay the loop on each iteration?
  Reply With Quote