From 51e904f82161b2ea2a9aa6f57ec9bae244aa8bb9 Mon Sep 17 00:00:00 2001 From: Edvinas Date: Wed, 18 Oct 2023 17:52:49 +0300 Subject: [PATCH] Fix storage retrieval returning `true` even if value is missing --- .../com.chark.game-management/Runtime/Storage/Storage.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Packages/com.chark.game-management/Runtime/Storage/Storage.cs b/Packages/com.chark.game-management/Runtime/Storage/Storage.cs index b7c3627..4af8e1d 100644 --- a/Packages/com.chark.game-management/Runtime/Storage/Storage.cs +++ b/Packages/com.chark.game-management/Runtime/Storage/Storage.cs @@ -53,12 +53,12 @@ public virtual bool TryGetValue(string path, out TValue value) return false; } - if (serializer.TryDeserializeValue(stringValue, out TValue deserializedValue)) + if (serializer.TryDeserializeValue(stringValue, out TValue deserializedValue) == false) { - value = deserializedValue; - return true; + return false; } + value = deserializedValue; return true; }