summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeerror.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml/qdeclarativeerror.cpp')
-rw-r--r--src/declarative/qml/qdeclarativeerror.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativeerror.cpp b/src/declarative/qml/qdeclarativeerror.cpp
index 17e91e3..8717f56 100644
--- a/src/declarative/qml/qdeclarativeerror.cpp
+++ b/src/declarative/qml/qdeclarativeerror.cpp
@@ -216,9 +216,15 @@ void QDeclarativeError::setColumn(int column)
QString QDeclarativeError::toString() const
{
QString rv;
- rv = url().toString() + QLatin1Char(':') + QString::number(line());
- if(column() != -1)
- rv += QLatin1Char(':') + QString::number(column());
+ if (url().isEmpty()) {
+ rv = QLatin1String("<Unknown File>");
+ } else if (line() != -1) {
+ rv = url().toString() + QLatin1Char(':') + QString::number(line());
+ if(column() != -1)
+ rv += QLatin1Char(':') + QString::number(column());
+ } else {
+ rv = url().toString();
+ }
rv += QLatin1String(": ") + description();