[libpeas] engine: add assertion for GLib pre-2.44



commit 8007883516f44f2d6da65a0d4998c43e44f464ba
Author: Christian Hergert <chergert redhat com>
Date:   Thu Aug 18 14:10:14 2022 -0700

    engine: add assertion for GLib pre-2.44
    
    We realistically aren't running on these systems, but we might as well be
    explicit with the comment so that people know what the comment was
    referring to.

 libpeas/peas-engine.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index c0ccae8..a2202a5 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -167,6 +167,14 @@ plugin_info_add_sorted (GQueue         *plugin_list,
            peas_plugin_info_get_module_name (info),
            peas_plugin_info_get_module_name (furthest_dep->data));
 
+  /* GLib only accepts NULL for g_queue_insert_after() at
+   * version 2.44 and above so make sure NULL is handled
+   * before reaching here.
+   */
+#if !GLIB_CHECK_VERSION(2,44,0)
+  g_assert (furthest_dep != NULL);
+#endif
+
   g_queue_insert_after (plugin_list, furthest_dep, info);
 }
 


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