Version 1.1.9 (02-11-2020)

Ulrik Larsen [11-02-20 - 18:48]
Version 1.1.9 (02-11-2020)
- Fixed issue when creating categories as subcategories would cause an exception when trying to fetch the number of subcategories on them.
Filename
CBs_Constants.lua
Changelog
CollectionBars.txt
diff --git a/CBs_Constants.lua b/CBs_Constants.lua
index 1f4091d..828a8f6 100644
--- a/CBs_Constants.lua
+++ b/CBs_Constants.lua
@@ -7,7 +7,7 @@ Filename: CBs_Constants.lua
 -------------------------------------------------------------------------------------------------
 CollectionBars = {
     WM = GetWindowManager(),
-    Addon = {Name = "CollectionBars", DisplayName = "Collection Bars", Abbreviation = "CBs", Version = 1.1, MinorVersion = 8, SettingsSlash = "/cb", Author = "Jarth"},
+    Addon = {Name = "CollectionBars", DisplayName = "Collection Bars", Abbreviation = "CBs", Version = 1.1, MinorVersion = 9, SettingsSlash = "/cb", Author = "Jarth"},
     AllButtons = {},
     Default = {
         UseAccountSettings = true,
@@ -125,7 +125,7 @@ function base:AddSubCategories(categoryData, parentKeyboardIcons, parentKey)
     base:Debug("AddSubCategories", categoryData, parentKeyboardIcons, parentKey)
     for _, subcategoryData in categoryData:SubcategoryIterator({ZO_CollectibleCategoryData.HasShownCollectiblesInCollection}) do
         local categoryType = base.GetCategoryTypeFromCollectible(subcategoryData)
-        local hasSubCategories = subcategoryData:GetNumSubcategories() > 0
+        local hasSubCategories = subcategoryData.subcategories ~= nil and subcategoryData:GetNumSubcategories() > 0
         base.AddCategory(subcategoryData, categoryType, parentKeyboardIcons, hasSubCategories, parentKey)
         if hasSubCategories then
             local subcategoryParentKey = subcategoryData:GetFormattedName()
diff --git a/Changelog b/Changelog
index db7fa7f..c8416a8 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,9 @@
 -------------------------------------------------------------------------------
  Collection bars
 -------------------------------------------------------------------------------
+Version 1.1.9 (02-11-2020)
+- Fixed issue when creating categories as subcategories would cause an exception when trying to fetch the number of subcategories on them.
+
 Version 1.1.8 (31-08-2020)
 - Fixed issue where the category type would not be set for categories.
 -- Resulting in Unlocked count not being set, and sliders not working.
diff --git a/CollectionBars.txt b/CollectionBars.txt
index b6a68d5..e7458a9 100644
--- a/CollectionBars.txt
+++ b/CollectionBars.txt
@@ -4,10 +4,10 @@
 ; States and/or other countries. All rights reserved.
 ; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms

-## APIVersion: 100032
+## APIVersion: 100033
 ## Title: Collection Bars
-## AddOnVersion: 10108
-## Version: 1.1.8
+## AddOnVersion: 10109
+## Version: 1.1.9
 ## Author: Jarth
 ## Description: Show collection bars and activate collections with key or button press. Shortcuts: Settings window: /cb OptionalDependsOn: LibDebugLogger (Logging can be enabled in settings)
 ##