Bug 24778 — throw_error() segfaults for daemon-internally called methods
Some functions like devkit_disks_device_drive_ata_smart_refresh_data() are used
internally by the daemon, in which case the DBusGMethodInvocation context is
NULL. If these methods throw an error (observed on "daemon is inhibited"), this
NULL context is propagated all the way down to throw_error, which previously
tried to call dbus_g_method_return_error() with a NULL context; there is no
D-Bus method call to terminate, so this caused a segfault.
Change throw_error() to just use g_warning() in this case, so that the error
appears on the daemon's stderr. This makes it generally safe to internally call
D-Bus exported methods.
Signed-off-by: David Zeuthen <davidz@redhat.com>