]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
ply-label: Make NULL safe
authorRay Strode <rstrode@redhat.com>
Fri, 22 Dec 2023 13:27:30 +0000 (08:27 -0500)
committerRay Strode <rstrode@redhat.com>
Fri, 22 Dec 2023 13:29:13 +0000 (08:29 -0500)
commit 42d07913a0b72b8607190ab31931d5460765f589 made the pango plugin
NULL safe but the same problem exists in the freetype plugin.

This commit makes things NULL safe a layer higher.

src/libply-splash-graphics/ply-label.c

index acdae83b0bde2d4f2458397ae20c4d3867a82898..0c03ebc5c827d71ada17f54541d86d5d7c50e5a8 100644 (file)
@@ -157,7 +157,7 @@ ply_label_load_plugin (ply_label_t *label)
         if (label->text != NULL) {
                 if (label->rich_text == NULL) {
                         label->plugin_interface->set_text_for_control (label->control,
-                                                                       label->text);
+                                                                       label->text?: "");
                 } else {
                         label->plugin_interface->set_rich_text_for_control (label->control,
                                                                             label->rich_text,
@@ -259,7 +259,7 @@ ply_label_set_text (ply_label_t *label,
                 return;
 
         label->plugin_interface->set_text_for_control (label->control,
-                                                       text);
+                                                       text?: "");
 }
 
 void