Fixed a bug when opening a new book.
Jayden Platell [04-30-14 - 08:22]
Fixed a bug when opening a new book.
diff --git a/Librarian.lua b/Librarian.lua
index f0605cd..1f23c5e 100644
--- a/Librarian.lua
+++ b/Librarian.lua
@@ -95,7 +95,7 @@ function Librarian:AddLoreReaderUnreadToggle()
alignment = KEYBIND_STRIP_ALIGN_RIGHT,
name = function()
local book = self:FindBook(LORE_READER.titleText)
- if book.unread then
+ if not book or book.unread then
if self.settings.showUnreadIndicatorInReader then
self.unreadIndicator:SetHidden(false)
else
@@ -110,6 +110,7 @@ function Librarian:AddLoreReaderUnreadToggle()
keybind = "UI_SHORTCUT_SECONDARY",
callback = function()
local book = self:FindBook(LORE_READER.titleText)
+ if not book then return end
book.unread = not book.unread
KEYBIND_STRIP:UpdateKeybindButtonGroup(LORE_READER.keybindStripDescriptor)
self:RefreshData()