Skip to content
Permalink
Browse files

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

Fixes #20943

(cherry picked from commit 3bc06e2)
  • Loading branch information
nyalldawson committed Jan 14, 2019
1 parent d35228d commit 3b2334424efa21c0d0cf309409663b53414d129c
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 3b23344

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