diff --git a/CharacterSelect.lua b/CharacterSelect.lua index 9535b65..d6f5d2d 100644 --- a/CharacterSelect.lua +++ b/CharacterSelect.lua @@ -685,6 +685,12 @@ function CharacterOrder_Save() local realm = GetServerName() or ""; if ( realm == "" ) then return; end local numChars = GetNumCharacters(); + -- Skip when the list is empty. CHARACTER_LIST_UPDATE can fire in a + -- transient state (returning to glue after logout, before the server's + -- SMSG_CHAR_ENUM populates the list) where numChars is briefly 0. + -- Writing an empty string here would wipe the saved order before the + -- real update arrives to Apply it. + if ( numChars == 0 ) then return; end local names = {}; for i = 1, numChars do local name = GetCharacterInfo(GetCharIDFromIndex(i));