diff options
author | Peter Grasch <grasch@simon-listens.org> | 2011-08-31 09:32:00 (GMT) |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@nokia.com> | 2011-08-31 09:32:00 (GMT) |
commit | 7fb04c5964e47e71b709a413be7839a3cedbba9e (patch) | |
tree | 5875ad0ccc3a3d05f36161ad55c6c1d89a0534a3 /tools | |
parent | 75170711a3486384ca3d66563c4b011a2505af39 (diff) | |
download | Qt-7fb04c5964e47e71b709a413be7839a3cedbba9e.zip Qt-7fb04c5964e47e71b709a413be7839a3cedbba9e.tar.gz Qt-7fb04c5964e47e71b709a413be7839a3cedbba9e.tar.bz2 |
Silently ignore a wrong parameter count instead of crashing
Merge-request: 1363
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdbus/qdbus/qdbus.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/qdbus/qdbus/qdbus.cpp b/tools/qdbus/qdbus/qdbus.cpp index 4e90418..757267f 100644 --- a/tools/qdbus/qdbus/qdbus.cpp +++ b/tools/qdbus/qdbus/qdbus.cpp @@ -455,10 +455,11 @@ int main(int argc, char **argv) if (arg == QLatin1String("--system")) { connection = QDBusConnection::systemBus(); connectionOpened = true; - } else - if (arg == QLatin1String("--address")) { - connection = QDBusConnection::connectToBus(args.takeFirst(), "bus"); - connectionOpened = true; + } else if (arg == QLatin1String("--address")) { + if (!args.isEmpty()) { + connection = QDBusConnection::connectToBus(args.takeFirst(), "bus"); + connectionOpened = true; + } } else if (arg == QLatin1String("--literal")) { printArgumentsLiterally = true; } else if (arg == QLatin1String("--help")) { |