mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Dynamic data models - Don't throw on dynamic child type mismatch
This commit is contained in:
parent
0e07dbd631
commit
dd592efef2
@ -258,7 +258,12 @@ namespace Artemis.Core.Modules
|
|||||||
internal T? GetDynamicChildValue<T>(string key)
|
internal T? GetDynamicChildValue<T>(string key)
|
||||||
{
|
{
|
||||||
if (TryGetDynamicChild(key, out DynamicChild? dynamicChild) && dynamicChild.BaseValue != null)
|
if (TryGetDynamicChild(key, out DynamicChild? dynamicChild) && dynamicChild.BaseValue != null)
|
||||||
return (T) dynamicChild.BaseValue;
|
{
|
||||||
|
if (dynamicChild.BaseValue is T value)
|
||||||
|
return value;
|
||||||
|
return default;
|
||||||
|
}
|
||||||
|
|
||||||
return default;
|
return default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user