summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/login/logind-user.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index c0b473930d..a9cf529e12 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -763,6 +763,9 @@ static int elect_display_compare(Session *s1, Session *s2) {
* is preferred.
*
* s1 or s2 may be NULL. */
+ if (!s1 && !s2)
+ return 0;
+
if ((s1 == NULL) != (s2 == NULL))
return (s1 == NULL) - (s2 == NULL);