diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index be6bb5c18..ed725e555 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -262,6 +262,9 @@ int CComponentsForm::genIndex() CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id) const { + if (v_cc_items.empty()) + return NULL; + if (cc_item_id >= size()){ dprintf(DEBUG_NORMAL, "[CComponentsForm] [%s - %d] Error: inside container type = [%d] [%s] parameter cc_item_id = %u, out of range (size = %zx)...\n", __func__, __LINE__, cc_item_type.id, cc_item_type.name.c_str(), cc_item_id, size()); return NULL; @@ -269,6 +272,7 @@ CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id) const if (v_cc_items.at(cc_item_id)) return v_cc_items.at(cc_item_id); + return NULL; }