From f3cf8dcc706cc6953da0d6f225c10b1af11bbe5c Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 2 Feb 2021 11:01:30 +0100 Subject: [PATCH] cast regardless of type in GenericDataHolder --- MLEM/Misc/GenericDataHolder.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MLEM/Misc/GenericDataHolder.cs b/MLEM/Misc/GenericDataHolder.cs index c9bdd64..c36a7e9 100644 --- a/MLEM/Misc/GenericDataHolder.cs +++ b/MLEM/Misc/GenericDataHolder.cs @@ -24,8 +24,8 @@ namespace MLEM.Misc { /// public T GetData(string key) { - if (this.data != null && this.data.TryGetValue(key, out var val) && val is T t) - return t; + if (this.data != null && this.data.TryGetValue(key, out var val)) + return (T) val; return default; }