Version 1.0.6 (03-11-2019)

Jarth [11-03-19 - 07:31]
Version 1.0.6 (03-11-2019)
- Updated APIVersion to 100029
- Fixed an issue when activating certan mementos:
 user:/AddOns/CollectionBars/CBs_Buttons.lua:125: operator + is not supported for nil + number
-- Added guard, so start time defaults to 0 in:
--- base.GetCooldownText(countDown, duration)
--  base.IsCollectibleUsable(button)
Filename
CBs_Buttons.lua
CBs_Constants.lua
Changelog
CollectionBars.txt
diff --git a/CBs_Buttons.lua b/CBs_Buttons.lua
index f324021..76bed2f 100644
--- a/CBs_Buttons.lua
+++ b/CBs_Buttons.lua
@@ -110,7 +110,8 @@ function base.GetCooldownText(countDown, duration)
     local cooldown = ""

     if type(duration) == "number" and countDown.StartTime ~= nil then
-        local secondsRemaining = math.max(countDown.StartTime + duration - GetFrameTimeMilliseconds(), 0) / 1000
+        local startTime = countDown.StartTime or 0
+        local secondsRemaining = math.max(startTime + duration - GetFrameTimeMilliseconds(), 0) / 1000
         cooldown = ZO_FormatTimeAsDecimalWhenBelowThreshold(secondsRemaining, 60)
     end

@@ -121,8 +122,9 @@ function base.IsCollectibleUsable(button)
     local isCollectibleUsable = button ~= nil and button.type.Cooldown.StartTime == nil and IsCollectibleUsable(button.cId)

     if not isCollectibleUsable and button.cId then
+        local startTime = button.type.Cooldown.StartTime or 0
         local _, duration = GetCollectibleCooldownAndDuration(button.cId)
-        isCollectibleUsable = button.type.Cooldown.StartTime + duration < GetFrameTimeMilliseconds()
+        isCollectibleUsable = startTime + duration < GetFrameTimeMilliseconds()
     end

     return isCollectibleUsable
diff --git a/CBs_Constants.lua b/CBs_Constants.lua
index 008316e..57bbace 100644
--- a/CBs_Constants.lua
+++ b/CBs_Constants.lua
@@ -12,7 +12,7 @@ CollectionBars = {
         DisplayName = "Collection Bars",
         Abbreviation = "CBs",
         Version = 1.0,
-        MinorVersion = 0.5,
+        MinorVersion = 0.6,
         Command = "/cb_menu",
         SettingsSlash = "/cb",
         Author = "Jarth",
diff --git a/Changelog b/Changelog
index 15e6cbe..0962223 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,14 @@
 -------------------------------------------------------------------------------
  Collection bars
 -------------------------------------------------------------------------------
+Version 1.0.6 (03-11-2019)
+- Updated APIVersion to 100029
+- Fixed an issue when activating certan mementos:
+ user:/AddOns/CollectionBars/CBs_Buttons.lua:125: operator + is not supported for nil + number
+-- Added guard, so start time defaults to 0 in:
+--- base.GetCooldownText(countDown, duration)
+--  base.IsCollectibleUsable(button)
+
 Version 1.0.5 (08-09-2019)
 - Fixed issue hiding labels, when they are not combined, and the settings tab is not enabled
 - Fixed issue with when moving the frame, and has the label anchor set other than a corner
diff --git a/CollectionBars.txt b/CollectionBars.txt
index c8cd226..d1c8074 100644
--- a/CollectionBars.txt
+++ b/CollectionBars.txt
@@ -4,9 +4,9 @@
 ; States and/or other countries. All rights reserved.
 ; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms

-## APIVersion: 100028
+## APIVersion: 100029
 ## Title: Collection Bars
-## Version: 1.0.5
+## Version: 1.0.6
 ## Author: Jarth
 ## Description: Show collection bars and activate collections with key or button press. Shortcuts: Settings window: /cb LibAddonMenu: /cb_menu
 ##