Browse Source

Fixed infinite loop when node type of node view model could not be determined

CPKreuz 11 months ago
parent
commit
d3ccca69df
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/PixiEditor/ViewModels/Nodes/NodeTypeInfo.cs

+ 3 - 1
src/PixiEditor/ViewModels/Nodes/NodeTypeInfo.cs

@@ -41,7 +41,7 @@ public class NodeTypeInfo
 
     private Type GetNodeType(Type? baseType)
     {
-        while (true)
+        while (baseType != null)
         {
             if (baseType.IsGenericType)
             {
@@ -55,5 +55,7 @@ public class NodeTypeInfo
 
             baseType = baseType.BaseType;
         }
+
+        throw new NullReferenceException($"Could not find node type of '{baseType}' in base classes");
     }
 }