[gnome-builder/wip/gtk4-port: 1427/1774] libide/projects: handle NULL license text




commit 0263eeada0dab200e8f426d3062709df140e849b
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jun 8 13:57:29 2022 -0700

    libide/projects: handle NULL license text

 src/libide/projects/ide-template-input.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/libide/projects/ide-template-input.c b/src/libide/projects/ide-template-input.c
index fac3e9abf..f20de3ca7 100644
--- a/src/libide/projects/ide-template-input.c
+++ b/src/libide/projects/ide-template-input.c
@@ -988,8 +988,13 @@ ide_template_input_get_license_path (IdeTemplateInput *self)
   for (guint i = 0; i < G_N_ELEMENTS (licenses); i++)
     {
       if (g_strcmp0 (licenses[i].spdx, self->license_name) == 0)
-        return g_strdup_printf ("/org/gnome/libide-projects/licenses/%s",
-                                licenses[i].full_path);
+        {
+          if (licenses[i].full_path == NULL)
+            return NULL;
+
+          return g_strdup_printf ("/org/gnome/libide-projects/licenses/%s",
+                                  licenses[i].full_path);
+        }
     }
 
   return NULL;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]