1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-26 06:28:35 +01:00

cast regardless of type in GenericDataHolder

This commit is contained in:
Ell 2021-02-02 11:01:30 +01:00
parent 3a0e2354b3
commit f3cf8dcc70

View file

@ -24,8 +24,8 @@ namespace MLEM.Misc {
/// <inheritdoc />
public T GetData<T>(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;
}