Skip to content

Commit d0728ef

Browse files
committed
Avoid crash with invalid indx
1 parent df11d7f commit d0728ef

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/qgsgeometryvalidationdock.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ void QgsGeometryValidationDock::updateCurrentError()
160160

161161
QModelIndex QgsGeometryValidationDock::currentIndex() const
162162
{
163-
return mErrorListView->selectionModel()->currentIndex();
163+
if ( !mGeometryValidationModel->rowCount() )
164+
return QModelIndex();
165+
else
166+
return mErrorListView->selectionModel()->currentIndex();
164167
}
165168

166169
void QgsGeometryValidationDock::onCurrentErrorChanged( const QModelIndex &current, const QModelIndex &previous )

0 commit comments

Comments
 (0)