diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index ec9d8ed5932..a5cf85cd91d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -458,9 +458,9 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber, // The text editors count columns starting with 0, but the ASTs store the // location starting with 1, therefore the -1. - EditorManager::openEditorAt(projectFileName, lineNumber, columnNumber - 1, Id(), - EditorManager::DoNotSwitchToDesignMode - | EditorManager::DoNotSwitchToEditMode); + EditorManager::openEditorAt( + projectFileName, lineNumber == 0 ? 1 : lineNumber, columnNumber - 1, Id(), + EditorManager::DoNotSwitchToDesignMode | EditorManager::DoNotSwitchToEditMode); } void QmlProfilerTool::updateTimeDisplay()