kate: return null pointer from KateBuildView::currentTargetSet() if the target list is empty

fixes crash when the katebuild-plugin is enabled and "Build Target..."
action is activated without restarting kate, the action will do nothing
until kate is restarted tho which is something that needs a fix too

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-05-23 18:43:57 +03:00
parent d77a116f35
commit f2a683c7b2

View file

@ -670,7 +670,7 @@ void KateBuildView::slotSelectTarget() {
/******************************************************************/ /******************************************************************/
KateBuildView::TargetSet* KateBuildView::currentTargetSet() KateBuildView::TargetSet* KateBuildView::currentTargetSet()
{ {
if (m_targetIndex >= m_targetList.size()) { if (m_targetIndex >= m_targetList.size() || m_targetList.isEmpty()) {
return 0; return 0;
} }