From 430ae043be8166b8afe7f0a2b2c3097dc001bbfe Mon Sep 17 00:00:00 2001 From: Brad Morgan Date: Mon, 26 Sep 2022 05:51:08 -0600 Subject: [PATCH] Test for DataStore before using it --- Plugins/DataStoreAuctions.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Plugins/DataStoreAuctions.lua b/Plugins/DataStoreAuctions.lua index b3b3f1e..5a4ede3 100644 --- a/Plugins/DataStoreAuctions.lua +++ b/Plugins/DataStoreAuctions.lua @@ -59,10 +59,12 @@ function plugin.OnInitialize() Skillet.db.profile.plugins.DSA.enabled = true end Skillet:AddPluginOptions(plugin.options) - for characterName, character in pairs(DataStore:GetCharacters()) do - --DA.DEBUG(0,"OnInitialize: characterName= "..tostring(characterName)..", character= "..tostring(character)) - if CharacterName == Skillet.currentPlayer then - Skillet.DSAPlayer = character + if DataStore then + for characterName, character in pairs(DataStore:GetCharacters()) do + --DA.DEBUG(0,"OnInitialize: characterName= "..tostring(characterName)..", character= "..tostring(character)) + if CharacterName == Skillet.currentPlayer then + Skillet.DSAPlayer = character + end end end end