Skip to content

Commit

Permalink
fix segfault on bad reply
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Oct 26, 2018
1 parent 89d061d commit f158c77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/powerkit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ QStringList PowerKit::find()
DBUS_INTROSPECTABLE,
"Introspect");
QDBusPendingReply<QString> reply = QDBusConnection::systemBus().call(call);
if (reply.isError()) {
qWarning() << "powerkit find devices failed, check the upower service!!!";
return result;
}
QList<QDBusObjectPath> objects;
QXmlStreamReader xml(reply.value());
while (!xml.atEnd()) {
Expand Down

0 comments on commit f158c77

Please sign in to comment.