diff --git a/source/glest_game/facilities/components.cpp b/source/glest_game/facilities/components.cpp index 091b9f5c7..160a53bf1 100644 --- a/source/glest_game/facilities/components.cpp +++ b/source/glest_game/facilities/components.cpp @@ -11,7 +11,7 @@ #include "components.h" -#include +//#include #include #include "metrics.h" @@ -410,7 +410,10 @@ void GraphicListBox::setItems(const vector &items, const vector } void GraphicListBox::setSelectedItemIndex(int index, bool errorOnMissing){ - if(errorOnMissing == true) assert(index>=0 && index=0 && index= items.size())) { + throw megaglest_runtime_error("Index not found on list box: " + intToStr(index) + " size: " + intToStr(items.size())); + } selectedItemIndex= index; setText(getSelectedItem()); }