diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2009-09-15 12:28:41 (GMT) |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2009-09-15 12:28:41 (GMT) |
commit | 6ce895506320be6b61169cca9243302b91a0cda6 (patch) | |
tree | 90dce9b3dda53930409df071d3c7552eadf66124 /src/declarative/qml/qmlinfo.cpp | |
parent | 2795a73158280ddce4eec57c643d367bb402a03d (diff) | |
download | Qt-6ce895506320be6b61169cca9243302b91a0cda6.zip Qt-6ce895506320be6b61169cca9243302b91a0cda6.tar.gz Qt-6ce895506320be6b61169cca9243302b91a0cda6.tar.bz2 |
Do not crash in QmlInfo if debugging information is missing
Properly initialize the members of QmlDeclarativeData, and check
whether outerContext has been set in QmlInfo.
Diffstat (limited to 'src/declarative/qml/qmlinfo.cpp')
-rw-r--r-- | src/declarative/qml/qmlinfo.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qmlinfo.cpp index e47b4ab..bae1682 100644 --- a/src/declarative/qml/qmlinfo.cpp +++ b/src/declarative/qml/qmlinfo.cpp @@ -85,7 +85,11 @@ QmlInfo::QmlInfo(QObject *object) QmlDeclarativeData *ddata = QmlDeclarativeData::get(object); if (ddata) { QString location = QLatin1String("("); - location += ddata->outerContext->baseUrl().toString(); + if (ddata->outerContext) { + location += ddata->outerContext->baseUrl().toString(); + } else { + location += "unknown"; + } location += QLatin1String(":"); location += QString::number(ddata->lineNumber); location += QLatin1String(":"); |