From fb7a167577b843b0731d1c28de40973d06f070b0 Mon Sep 17 00:00:00 2001 From: MatheusTT Date: Mon, 30 Jan 2023 13:44:29 -0300 Subject: [PATCH] fixed default() not returning the second value if the first is empty. --- playerctl/playerctl-formatter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playerctl/playerctl-formatter.c b/playerctl/playerctl-formatter.c index caeb853..6a284b7 100644 --- a/playerctl/playerctl-formatter.c +++ b/playerctl/playerctl-formatter.c @@ -558,8 +558,8 @@ static GVariant *helperfn_default(struct token *token, GVariant **args, int narg g_variant_ref(args[1]); return args[1]; } else { - if (g_variant_is_of_type(args[0], G_VARIANT_TYPE_STRING) && - strlen(g_variant_get_string(args[0], NULL)) == 0) { + if (g_variant_is_of_type(args[0], G_VARIANT_TYPE_STRING_ARRAY) && + strlen(pctl_print_gvariant(args[0])) == 0) { g_variant_ref(args[1]); return args[1]; }