diff --git a/src/slic3r/GUI/GUI_ObjectLayers.cpp b/src/slic3r/GUI/GUI_ObjectLayers.cpp index 6f6ec523808..4727c6d30b1 100644 --- a/src/slic3r/GUI/GUI_ObjectLayers.cpp +++ b/src/slic3r/GUI/GUI_ObjectLayers.cpp @@ -283,7 +283,7 @@ void ObjectLayers::sys_color_changed() if (item->IsSizer()) {// case when we have editor with buttons for (size_t btn : {2, 3}) { // del_btn, add_btn wxSizerItem* b_item = item->GetSizer()->GetItem(btn); - if (b_item->IsWindow()) { + if (b_item && b_item->IsWindow()) { auto button = dynamic_cast(b_item->GetWindow()); if (button != nullptr) button->sys_color_changed();