linux: Fix crash if logind doesn't return an error

For example, when using an incomplete mock logind.
This commit is contained in:
Bastien Nocera 2018-04-12 22:32:13 +02:00
parent 598fdbc5e0
commit c68daf665f

View file

@ -668,7 +668,8 @@ up_backend_inhibitor_lock_take (UpBackend *backend)
NULL,
&error);
if (out == NULL) {
g_warning ("Could not acquire inhibitor lock: %s", error->message);
g_warning ("Could not acquire inhibitor lock: %s",
error ? error->message : "Unknown reason");
return;
}