Isn't it normal behaviour for any Get*Info function? I don't think GetQuestItemInfo is different from GetItemInfo. If item isn't cached yet, you'll get either incomplete data or a bunch of nils.
When you request info on not yet cached item, you need to register for
GET_ITEM_INFO_RECEIVED event, after this event fires you need to request info again, but I'm not sure if GET_ITEM_INFO_RECEIVED fires after GetQuestItemInfo calls
Alternatively you may try to call stuff recursively w/ some delay if info is missing:
Lua Code:
local function test_func(itemID)
local _, link = GetItemInfo(itemID)
if not link then
return C_Timer.After(0.25, function() test_func(itemID) end)
end
-- do everything else here
end
Some checks to avoid infinite loops may be quite useful too