mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-29 15:58:33 +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 />
|
/// <inheritdoc />
|
||||||
public T GetData<T>(string key) {
|
public T GetData<T>(string key) {
|
||||||
if (this.data != null && this.data.TryGetValue(key, out var val) && val is T t)
|
if (this.data != null && this.data.TryGetValue(key, out var val))
|
||||||
return t;
|
return (T) val;
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue