From b85a533ca4f146e70186b830d5a8e327b1627837 Mon Sep 17 00:00:00 2001 From: copygirl Date: Sat, 6 May 2023 21:21:46 +0200 Subject: [PATCH] Throw in EntityPath.From if entity is None --- src/gaemstone.ECS/EntityPath.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gaemstone.ECS/EntityPath.cs b/src/gaemstone.ECS/EntityPath.cs index 9f68ecb..79b8f4e 100644 --- a/src/gaemstone.ECS/EntityPath.cs +++ b/src/gaemstone.ECS/EntityPath.cs @@ -52,6 +52,9 @@ public class EntityPath public static unsafe EntityPath From(World world, Entity entity) { + if (entity.IsNone) throw new ArgumentException( + "entity is Entity.None", nameof(entity)); + var parts = new List(32); do {