Merge branch 'editable-check-text' into 'main'

Add additional check for NULL text in GtkEditable

See merge request GNOME/gtk!6174
This commit is contained in:
Matthias Clasen 2024-02-20 18:15:42 +00:00
commit 7e9f2e2311

View File

@ -486,6 +486,9 @@ gtk_editable_insert_text (GtkEditable *editable,
g_return_if_fail (length >= -1);
g_return_if_fail (position != NULL);
if (text == NULL)
text = "";
if (length < 0)
length = strlen (text);
@ -600,6 +603,7 @@ gtk_editable_set_text (GtkEditable *editable,
int pos;
g_return_if_fail (GTK_IS_EDITABLE (editable));
g_return_if_fail (text != NULL);
g_object_freeze_notify (G_OBJECT (editable));
gtk_editable_delete_text (editable, 0, -1);