# HG changeset patch # User Chris Cannam # Date 1524495891 -3600 # Node ID d967e21fe99582d2ca2507471b73f1e8224bd6f1 # Parent 7527701c8076cb0fe6fe98b859a0bc6f8392685b Avoid crash when scrolling with an empty layer open diff -r 7527701c8076 -r d967e21fe995 widgets/ModelDataTableDialog.cpp --- a/widgets/ModelDataTableDialog.cpp Thu Apr 19 14:36:16 2018 +0100 +++ b/widgets/ModelDataTableDialog.cpp Mon Apr 23 16:04:51 2018 +0100 @@ -208,6 +208,12 @@ void ModelDataTableDialog::makeCurrent(int row) { + if (m_table->rowCount() == 0 || + row >= m_table->rowCount() || + row < 0) { + return; + } + int rh = m_tableView->height() / m_tableView->rowHeight(0); int topRow = row - rh/4; if (topRow < 0) topRow = 0;