From 7fb04c5964e47e71b709a413be7839a3cedbba9e Mon Sep 17 00:00:00 2001 From: Peter Grasch Date: Wed, 31 Aug 2011 11:32:00 +0200 Subject: Silently ignore a wrong parameter count instead of crashing Merge-request: 1363 Reviewed-by: Frederik Gladhorn --- tools/qdbus/qdbus/qdbus.cpp | 9 +++++---- 1 file 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")) { -- cgit v0.12