Fixed situation where some variables weren't initialized

CrazyDutchGuy [06-28-14 - 18:35]
Fixed situation where some variables weren't initialized
Filename
LibSort-1.0/LibSort-1.0.lua
diff --git a/LibSort-1.0/LibSort-1.0.lua b/LibSort-1.0/LibSort-1.0.lua
index cb5bd4c..11dbc92 100644
--- a/LibSort-1.0/LibSort-1.0.lua
+++ b/LibSort-1.0/LibSort-1.0.lua
@@ -1,8 +1,12 @@
-local MAJOR, MINOR = "LibSort-1.0", 4
+local MAJOR, MINOR = "LibSort-1.0", 5
 local LibSort, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 if not LibSort then return end	--the same or newer version of this lib is already loaded into memory

-LibSort.sortKeys = ZO_Inventory_GetDefaultHeaderSortKeys()
+if not LibSort.RegisteredCallbacks then LibSort.RegisteredCallbacks = {} end
+if not LibSort.AddonOrder then LibSort.AddonOrder = {} end
+if not LibSort.DefaultOrdersHigh then LibSort.DefaultOrdersHigh = {} end
+if not LibSort.DefaultOrdersLow then LibSort.DefaultOrdersLow = {} end
+if not LibSort.sortKeys then LibSort.sortKeys = ZO_Inventory_GetDefaultHeaderSortKeys() end

 -- Lookup Tables ---
 local defaultType = {["isNumeric"] = 0, ["isBoolean"] = false, ["isString"] = ""}
@@ -119,7 +123,7 @@ function LibSort:ProcessInventory(inventoryType)
 end

 function LibSort:Loaded(event, name)
-   	if name ~= "ZO_Ingame" then return end
+   	if name ~= "ZO_Ingame" then return end

 	ZO_PreHook(PLAYER_INVENTORY, "ApplySort", function(self, inventoryType) LibSort:ProcessInventory(inventoryType) end)
 	LibSort:SetupArrows()
@@ -147,10 +151,7 @@ end
 function LibSort:Register(addonName, name, desc, key, func, dataType)
 	if not dataType then dataType = "isNumeric" end

-	if not self.RegisteredCallbacks then self.RegisteredCallbacks = {} end
-	if not self.AddonOrder then self.AddonOrder = {} end
-	if not self.DefaultOrdersHigh then self.DefaultOrdersHigh = {} end
-	if not self.DefaultOrdersLow then self.DefaultOrdersLow = {} end
+

 	if not self.RegisteredCallbacks[addonName] then
 		self.RegisteredCallbacks[addonName] = {}