From e220fd9919a35e5d8513522781b1236fa0e21f15 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 28 Jan 2020 15:07:50 +0000 Subject: [PATCH] malcontent-control: Allow NULL user accounts If there are no suitable users to show in the user selector, then no user can be selected, so the controls have to handle a NULL user. Signed-off-by: Philip Withnall --- malcontent-control/user-controls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/malcontent-control/user-controls.c b/malcontent-control/user-controls.c index c15ba63..ca490df 100644 --- a/malcontent-control/user-controls.c +++ b/malcontent-control/user-controls.c @@ -53,7 +53,7 @@ struct _MctUserControls GSimpleActionGroup *action_group; /* (owned) */ - ActUser *user; /* (owned) */ + ActUser *user; /* (owned) (nullable) */ GPermission *permission; /* (owned) (nullable) */ gulong permission_allowed_id; @@ -1111,7 +1111,7 @@ mct_user_controls_set_user (MctUserControls *self, ActUser *user) { g_return_if_fail (MCT_IS_USER_CONTROLS (self)); - g_return_if_fail (ACT_IS_USER (user)); + g_return_if_fail (user == NULL || ACT_IS_USER (user)); /* If we have pending unsaved changes from the previous user, force them to be * saved first. */