Version 1.1.14 - 2

Ulrik Larsen [02-19-23 - 13:58]
Version 1.1.14 - 2
Filename
Changelog
bindings/Bindings.lua
diff --git a/Changelog b/Changelog
index 4cc47f8..44a6d63 100644
--- a/Changelog
+++ b/Changelog
@@ -206,4 +206,3 @@ Version 1.0.1 (06-05-2019)
 - Removed duplicate LibStub from lib: Libs\LibStub

 Version 1.0.0 (27-04-2019)
-
diff --git a/bindings/Bindings.lua b/bindings/Bindings.lua
index b454c6d..afbfac1 100644
--- a/bindings/Bindings.lua
+++ b/bindings/Bindings.lua
@@ -31,11 +31,13 @@ function CBs_Clicked(keyId)
 				base.Global.ReverseBindings[targetCollectibleId] = nil
 			end

-			local existingSourceBinding = existingCollectibleId ~= nil and base.Global.ReverseBindings[existingCollectibleId]
-			if existingSourceBinding ~= nil then
-				base.Saved.Bindings[existingSourceBinding] = nil
-				base.Global.ReverseBindings[existingCollectibleId] = nil
-				base:SetBindingText(existingCollectibleId)
+			if existingCollectibleId ~= nil then
+				local existingSourceBinding = base.Global.ReverseBindings[existingCollectibleId]
+				if existingSourceBinding ~= nil then
+					base.Saved.Bindings[existingSourceBinding] = nil
+					base.Global.ReverseBindings[existingCollectibleId] = nil
+					base:SetBindingText(existingCollectibleId)
+				end
 			end

 			base.Saved.Bindings[keyId] = targetCollectibleId