qmlprofiler: Fix a crash in the rangeFilter

Always check the stack before popping an element.

Fixes: QTCREATORBUG-24730
Change-Id: I7dc6363137ef002219fbc49b7343cff8112a58c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
Dominik Holland
2020-10-09 12:29:57 +02:00
parent 0f87be729c
commit db4b3641f5

View File

@@ -395,7 +395,7 @@ QmlProfilerModelManager::rangeFilter(qint64 rangeStart, qint64 rangeEnd) const
if (type.rangeType() != MaximumRangeType) {
if (event.rangeStage() == RangeStart)
stack.push(event);
else if (event.rangeStage() == RangeEnd)
else if (event.rangeStage() == RangeEnd && !stack.isEmpty())
stack.pop();
return true;
} else if (isStateful(type)) {