Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Don't "fail" when a dbus call returns no value
Browse files Browse the repository at this point in the history
Reported by Christian Surlykke:
https://groups.google.com/group/razor-qt/browse_thread/thread/34b2836c9a6ea414

(cherry picked from commit d8eeeaa35f03bf15e359a5816a822e64f7993cc4)
  • Loading branch information
amoskvin committed Dec 1, 2012
1 parent 8ab01ac commit 0755bad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/razorqt/razorpower/razorpowerproviders.cpp
Expand Up @@ -106,6 +106,7 @@ bool dbusCall(const QString &service,

// If the method no returns value, we believe that it was successful.
return msg.arguments().isEmpty() ||
msg.arguments().first().isNull() ||
msg.arguments().first().toBool();
}

Expand Down Expand Up @@ -153,7 +154,7 @@ bool dbusCallSystemd(const QString &service,
}

// If the method no returns value, we believe that it was successful.
if (msg.arguments().isEmpty())
if (msg.arguments().isEmpty() || msg.arguments().first().isNull())
return true;

QString response = msg.arguments().first().toString();
Expand Down

0 comments on commit 0755bad

Please sign in to comment.