QmlProfiler: prevent crash in events pane

When selecting event before the timeline has been
rendered at least once.

Change-Id: I8f34ebacb948163f57e3c2bc893d17c745366294
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2012-02-04 19:33:43 +01:00
parent 354bcaa893
commit 3ae24416aa

View File

@@ -350,7 +350,7 @@ QString TimelineView::getDetails(int index) const
int TimelineView::getYPosition(int index) const
{
Q_ASSERT(m_eventList);
if (index >= m_eventList->count())
if (index >= m_eventList->count() || m_rowStarts.isEmpty())
return 0;
int y, eventType = m_eventList->getType(index);
if (m_rowsExpanded[eventType])