Skip to content

Commit

Permalink
Remove raw event when it has no handlers. fix #2427 (#2583)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltca authored Dec 24, 2023
1 parent c35562a commit 158f3cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/raweditor/RawEditorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void RawEditorWidget::removeCurrentHandler()
m_pEditor->setEnabled(false);
m_pNameEditor->setEnabled(false);
if(!parent->childCount())
parent->setEnabled(false);
delete parent;
}
}

Expand Down Expand Up @@ -344,7 +344,7 @@ void RawEditorWidget::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *
{
KVI_ASSERT(m_bOneTimeSetupDone);
saveLastEditedItem();
if(it->parent())
if(it && it->parent())
{
m_pLastEditedItem = (RawHandlerTreeWidgetItem *)it;
m_pNameEditor->setEnabled(true);
Expand All @@ -358,7 +358,7 @@ void RawEditorWidget::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *
m_pNameEditor->setEnabled(false);
m_pNameEditor->setText("");
m_pEditor->setEnabled(false);
QString szTmp = QString(__tr2qs_ctx("\n\nRAW Event:\n%1", "editor")).arg(((RawHandlerTreeWidgetItem *)it)->text(0));
QString szTmp = it ? QString(__tr2qs_ctx("\n\nRAW Event:\n%1", "editor")).arg(((RawHandlerTreeWidgetItem *)it)->text(0)) : "";
m_pEditor->setText(szTmp);
}
}
Expand Down

0 comments on commit 158f3cc

Please sign in to comment.