analyzer: don't crash on "Goto Next Leak" if there is none.

Change-Id: I7829c7c93338fd4238b9148a9fed3be4f5f69687
Reviewed-by: con
Task-number: QTCREATORBUG-5386
Reviewed-on: http://codereview.qt.nokia.com/1427
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
hjk
2011-07-11 14:56:57 +02:00
committed by Eike Ziller
parent bd92b51296
commit 5f65d79605
2 changed files with 4 additions and 2 deletions

View File

@@ -509,11 +509,13 @@ void MemcheckErrorView::suppressError()
void MemcheckErrorView::goNext()
{
QTC_ASSERT(rowCount(), return);
setCurrentRow((currentRow() + 1) % rowCount());
}
void MemcheckErrorView::goBack()
{
QTC_ASSERT(rowCount(), return);
const int prevRow = currentRow() - 1;
setCurrentRow(prevRow >= 0 ? prevRow : rowCount() - 1);
}