QmlProfiler: Fix crash in range model

The first element in the expandedRowTypes is always -1 as that is the
empty row. Don't try to retrieve its type.

Change-Id: I1a4b59e0de6638201485d503e3be05afddf625fb
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-07-03 11:38:24 +02:00
parent 981bb850e9
commit 4ecefc6857

View File

@@ -371,7 +371,7 @@ int RangeTimelineModel::getEventIdForLocation(const QString &filename, int line,
// if this is called from v8 view, we don't have the column number, it will be -1
const QVector<QmlProfilerDataModel::QmlEventTypeData> &types =
d->modelManager->qmlModel()->getEventTypes();
for (int i = 0; i < d->expandedRowTypes.size(); ++i) {
for (int i = 1; i < d->expandedRowTypes.size(); ++i) {
int typeId = d->expandedRowTypes[i];
const QmlProfilerDataModel::QmlEventTypeData &eventData = types[typeId];
if (eventData.location.filename == filename &&