Skip to content
Permalink
Browse files

Fix crash in metadata widget when remove is clicked and no items exist

Fixes #20943
  • Loading branch information
nyalldawson committed Jan 14, 2019
1 parent 9b75a82 commit 3bc06e2bb9b5037a341503355d099638eb130561
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/gui/qgsmetadatawidget.cpp
@@ -295,6 +295,8 @@ void QgsMetadataWidget::addConstraint()
void QgsMetadataWidget::removeSelectedConstraint()
{
const QModelIndexList selectedRows = tabConstraints->selectionModel()->selectedRows();
if ( selectedRows.empty() )
return;
mConstraintsModel->removeRow( selectedRows[0].row() );
}

@@ -394,6 +396,9 @@ void QgsMetadataWidget::addLink()
void QgsMetadataWidget::removeSelectedLink()
{
const QModelIndexList selectedRows = tabLinks->selectionModel()->selectedRows();
if ( selectedRows.empty() )
return;

mLinksModel->removeRow( selectedRows[0].row() );
}

0 comments on commit 3bc06e2

Please sign in to comment.
You can’t perform that action at this time.