mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
gapplication: Add postconditions on calls to GApplication.dbus_register
Try and catch programmer errors in third-party implementations of `dbus_register()`. Signed-off-by: Philip Withnall <withnall@endlessm.com> Fixes: #1188
This commit is contained in:
parent
819409cf9a
commit
539621d2d3
@ -371,6 +371,7 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
|
||||
GApplicationFlags app_flags;
|
||||
GVariant *reply;
|
||||
guint32 rval;
|
||||
GError *local_error = NULL;
|
||||
|
||||
if (org_gtk_Application == NULL)
|
||||
{
|
||||
@ -430,8 +431,14 @@ g_application_impl_attempt_primary (GApplicationImpl *impl,
|
||||
if (!app_class->dbus_register (impl->app,
|
||||
impl->session_bus,
|
||||
impl->object_path,
|
||||
error))
|
||||
&local_error))
|
||||
{
|
||||
g_return_val_if_fail (local_error != NULL, FALSE);
|
||||
g_propagate_error (error, g_steal_pointer (&local_error));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (local_error == NULL, FALSE);
|
||||
|
||||
if (impl->bus_name == NULL)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user