mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 03:19:56 +00:00
Dynamic data models - Don't throw on dynamic child type mismatch
This commit is contained in:
1 parent
0e07dbd631
commit
dd592efef2
1 file changed
+6
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user