From 87e792b9200ec0dbd7e15129929b21d3fac57054 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 17 Mar 2022 08:41:22 +0100 Subject: [PATCH] Check if the ESS singleton exists in EquipmentData's constructor. --- modules/entity_spell_system/data/items/equipment_data.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/entity_spell_system/data/items/equipment_data.cpp b/modules/entity_spell_system/data/items/equipment_data.cpp index 0c0e5202a..d3bf228e3 100644 --- a/modules/entity_spell_system/data/items/equipment_data.cpp +++ b/modules/entity_spell_system/data/items/equipment_data.cpp @@ -50,7 +50,9 @@ Ref EquipmentData::get_item(int index) { } EquipmentData::EquipmentData() { - _entries.resize(ESS::get_singleton()->equip_slot_get_count()); + if (ESS::get_singleton()) { + _entries.resize(ESS::get_singleton()->equip_slot_get_count()); + } } EquipmentData::~EquipmentData() {