aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/debugger/watchhandler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 1587af28e77..7c5b221a630 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -780,8 +780,12 @@ bool operator<(const IName &iname1, const IName &iname2)
QString name1 = iname1.section('.', -1);
QString name2 = iname2.section('.', -1);
if (!name1.isEmpty() && !name2.isEmpty()) {
- if (name1.at(0).isDigit() && name2.at(0).isDigit())
- return name1.toInt() < name2.toInt();
+ if (name1.at(0).isDigit() && name2.at(0).isDigit()) {
+ bool ok1 = false, ok2 = false;
+ int i1 = name1.toInt(&ok1), i2 = name2.toInt(&ok2);
+ if (ok1 && ok2)
+ return i1 < i2;
+ }
}
return name1 < name2;
}