From 846b0efb04a60f0e4f88084994e6094306caff13 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 16 Jun 2026 14:21:36 +0200 Subject: [PATCH] mute-console: allow NULL being passed --- src/shared/prompt-util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/shared/prompt-util.c b/src/shared/prompt-util.c index 7837a90fa4..a7bcfe32e3 100644 --- a/src/shared/prompt-util.c +++ b/src/shared/prompt-util.c @@ -412,11 +412,12 @@ static int vl_on_reply(sd_varlink *link, sd_json_variant *parameters, const char int mute_console(sd_varlink **ret_link) { int r; - assert(ret_link); - /* Talks to the MuteConsole service, and asks for output to the console to be muted, as long as the * connection is retained */ + if (!ret_link) + return 0; + _cleanup_(sd_varlink_flush_close_unrefp) sd_varlink *link = NULL; r = sd_varlink_connect_address(&link, "/run/systemd/io.systemd.MuteConsole"); if (r < 0)