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:
parent
3a0e2354b3
commit
f3cf8dcc70
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue