summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlinfo.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2009-09-15 12:28:41 (GMT)
committerKai Koehne <kai.koehne@nokia.com>2009-09-15 12:28:41 (GMT)
commit6ce895506320be6b61169cca9243302b91a0cda6 (patch)
tree90dce9b3dda53930409df071d3c7552eadf66124 /src/declarative/qml/qmlinfo.cpp
parent2795a73158280ddce4eec57c643d367bb402a03d (diff)
downloadQt-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.cpp6
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(":");