Skip to content

Commit

Permalink
fix preview/model import crash if click select sibling on a preview
Browse files Browse the repository at this point in the history
  • Loading branch information
computergeek1507 committed Jan 4, 2025
1 parent 4ce7104 commit 0b99825
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xLights/ImportPreviewsModelsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ void ImportPreviewsModelsDialog::SelectRecursiveModel(wxString m, bool checked)
for (wxTreeListItem it = TreeListCtrl1->GetFirstItem(); it.IsOk(); it = TreeListCtrl1->GetNextItem(it)) {
if (model == TreeListCtrl1->GetItemText(it)) {
TreeListCtrl1->CheckItem(it, checked ? wxCHK_CHECKED : wxCHK_UNCHECKED);
if (((impTreeItemData*)TreeListCtrl1->GetItemData(it))->IsModelGroup()) {
auto* itm = ((impTreeItemData*)TreeListCtrl1->GetItemData(it));
if (itm && itm->IsModelGroup()) {
wxString const models = ((impTreeItemData*)TreeListCtrl1->GetItemData(it))->GetModelXml()->GetAttribute("models");
wxArrayString const modelArray = wxSplit(models, ',');
for (size_t i = 0; i < modelArray.size(); ++i) {
Expand Down

0 comments on commit 0b99825

Please sign in to comment.