Items without 'itemName' field causing an error when searching
tflo opened this issue · 4 comments
Continued from this CurseForge issue:
OP by me:
I reinstalled LastSeen, as it seems it is maintained again.
I did a test search (using my database from the previous years) and got
1x LastSeen/Handlers/Command.lua:100: bad argument #1 to 'lower' (string expected, got nil)
Turned out that I have 124 items without
itemName
field in myLastSeenDB.Items
, hence the nil.Adding a nil check for
item.itemName
in line 100 (and possibly 126 too) should prevent this, but I'm wondering why I have "nameless" items in the DB…
Should I consider the database corrupted, or is this normal (e.g. because of a data format change somewhere in the past)?I'm on WoW Retail.
Reply:
Hi 6mot,
First, thank you for opening an issue for the addon. I appreciate it.
Second, your database from the old generation of the addon was constructed at a time when I was less adept with the API. I'd prefer you not to consider it corrupted, and I'd like to use your database to build a solution for your problem. Would you be able and/or willing to share your LastSeen.lua saved variables file? I'm not sure if you can upload that directly here or if we need to use an external site, but I'm confident I can build a solution that prevents you from losing any data.
– LightskyGG
Would you be able and/or willing to share your LastSeen.lua saved variables file?
Sure, no problem:
The archive contains 2 files: One as of now ("Current"), and the other one is from when I installed the "new" LastSeen 2 days ago.
So you have A) a "first generation" database with only old entries, not touched by the new generation LS, and B) one that contains old entries plus the ones from the last days. Maybe this can help you to see if something unexpected happens when the "new" LS mixes into an old database.
Thank you. I'll look at this tonight. I've also pointed the issues on CF to this Github.