diff --git a/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs b/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs --- a/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs +++ b/isometric-park-fna/Engines/ImGuiWindowBridgeEngine.cs @@ -217,10 +217,14 @@ && (contractStatus.status == ContractStatus.Proposed)) { try { - this.showContractIndicator = true; - var organizationEntity = GetComponent(entity).Entity; - var name = GetComponent(organizationEntity).DisplayName; - this.contracts.Add(name); + this.showContractIndicator = true; + if (HasComponent(entity)) + { + var organizationEntity = GetComponent(entity).Entity; + var name = GetComponent(organizationEntity).DisplayName; + this.contracts.Add(name); + + } } catch (Exception e) { diff --git a/isometric-park-fna/Engines/Spawners/ContractSpawner.cs b/isometric-park-fna/Engines/Spawners/ContractSpawner.cs --- a/isometric-park-fna/Engines/Spawners/ContractSpawner.cs +++ b/isometric-park-fna/Engines/Spawners/ContractSpawner.cs @@ -127,6 +127,9 @@ { organization_type = GetComponent(contractOrganizations[organization_index]).type; } + else { + Logging.Debug(String.Format("Creating contract {0} without organizations.", message.name )); + } foreach (var (entity, status) in ReadEntities().SelectWhereF((e) => (e, GetComponent(e)), (e) => ((e.Item2.status != ContractStatus.Broken) && (e.Item2.status != ContractStatus.Rejected) && (e.Item2.status != ContractStatus.Expired)))) { var entitySquares = GetComponent(entity).squares;