From 7c54a3c92374dc727549afd30dc2beee63473161 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 29 Nov 2019 17:08:24 +0100 Subject: [PATCH] Fixes window destruction causing a crash. Fixes #473 --- Content.Client/GameObjects/EntitySystems/WindowSystem.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Content.Client/GameObjects/EntitySystems/WindowSystem.cs b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs index 30fc6a15a0..ae8e4c43b6 100644 --- a/Content.Client/GameObjects/EntitySystems/WindowSystem.cs +++ b/Content.Client/GameObjects/EntitySystems/WindowSystem.cs @@ -34,7 +34,13 @@ namespace Content.Client.GameObjects.EntitySystems // Performance: This could be spread over multiple updates, or made parallel. while (_dirtyEntities.Count > 0) { - _dirtyEntities.Dequeue().GetComponent().UpdateSprite(); + var entity = _dirtyEntities.Dequeue(); + if (entity.Deleted) + { + continue; + } + + entity.GetComponent().UpdateSprite(); } } }