diff --git a/DataStore2/init.lua b/DataStore2/init.lua index 04c1163..eb659b4 100644 --- a/DataStore2/init.lua +++ b/DataStore2/init.lua @@ -489,7 +489,7 @@ do self.combinedInitialGot = true tableResult[self.combinedName] = clone(tableValue) self.combinedStore:Set(tableResult, true) - return tableValue + return clone(tableValue) end function CombinedDataStore:Set(value, dontCallOnUpdate) diff --git a/Tests/tests/DataStore2.spec.lua b/Tests/tests/DataStore2.spec.lua index 01b9c07..d54c3a2 100644 --- a/Tests/tests/DataStore2.spec.lua +++ b/Tests/tests/DataStore2.spec.lua @@ -329,6 +329,12 @@ return function() dataStore:Increment(1) expect(called).to.equal(true) end) + + it("should not return an identical value for default values", function() + local dataStore = DataStore2(UUID(), fakePlayer) + local data = {} + expect(dataStore:Get(data)).to.never.equal(data) + end) end end