View Bug Report
AuldLangSyne.lua:492: attempt to index field `realm' (a nil value)
Bug #: 2216
File: AuldLangSyne
Date: 09-27-06 11:45 PM
By: Dhraga
Status: Fixed
Hiya Kemayo,

When trying to import CT_PlayerNotes I get this error:

AuldLangSyne.lua:492: attempt to index field `realm' (a nil value)
---

RSS 2.0 Feed for Bug CommentsNotes Sort Options
By: Dhraga - 09-28-06 12:14 AM
The error went away when I duplicated your check for the playernotes to the guild & ignore notes, it might not be the correct way of doing it but it worked anyway

/Dhraga

function AuldLangSyne:CTImport()
--CTPlayerNotes is popular. Ergo, we must steal its data.
--NOTE: This will overwrite any existing notes. This might be bad.

if CT_PlayerNotes then
--We can't scan over the CT_PlayerNotes, as that seems to include listings for all realms. Durnit.
for i=1, GetNumFriends() do
local name, level, class, area, connected, status = GetFriendInfo(i)
if CT_PlayerNotes[name] then
if not self.db.realm.chars[name] then self.db.realm.chars[name] = {} end
self.db.realm.chars[name].note = CT_PlayerNotes[name]
end
end
end
if CT_GuildNotes then
for i=1, GetNumGuildMembers(true) do
local name = GetGuildRosterInfo(i)
if CT_GuildNotes[name] then
-- self.realm.guild[name] = CT_GuildNotes[name]
if not self.db.realm.guild[name] then self.db.realm.guild[name] = {} end --dcui
self.db.realm.guild[name].note = CT_GuildNotes[name] --dcui
end
end
end
if CT_IgnoreNotes then
for i=1, GetNumIgnores() do
local name = GetIgnoreName(i)
if CT_IgnoreNotes[name] then
-- self.realm.ignore[name] = CT_IgnoreNotes[name]
if not self.db.realm.ignore[name] then self.db.realm.ignore[name] = {} end --dcui
self.db.realm.ignore[name].note = CT_IgnoreNotes[name] --dcui
end
end
end
end