1
0
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:
Robert 2021-08-06 22:23:17 +02:00
parent 0e07dbd631
commit dd592efef2

View File

@ -258,7 +258,12 @@ namespace Artemis.Core.Modules
internal T? GetDynamicChildValue<T>(string key)
{
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;
}