From afea4a8da5c5aaaa546dbe764839f4d6e81bff43 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 27 May 2023 19:05:32 +0200 Subject: [PATCH] stringsorter: Handle NULL strings NULL is a valid string GValue, so we need to handle it. The utf8 normalizing and collating functions do not, so we better catch it early. --- gtk/gtkstringsorter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gtk/gtkstringsorter.c b/gtk/gtkstringsorter.c index ed2a0ac34c..70739509e2 100644 --- a/gtk/gtkstringsorter.c +++ b/gtk/gtkstringsorter.c @@ -77,6 +77,11 @@ gtk_string_sorter_get_key (GtkExpression *expression, return NULL; string = g_value_get_string (&value); + if (string == NULL) + { + g_value_unset (&value); + return NULL; + } if (ignore_case) s = g_utf8_casefold (string, -1); -- 2.30.2