[template-glib] eval: add assertion for gtype



commit 9a4589341e70e08571e66d10325c028339b59e5e
Author: Christian Hergert <chergert redhat com>
Date:   Wed May 4 22:00:40 2022 -0700

    eval: add assertion for gtype

 src/tmpl-expr-eval.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/tmpl-expr-eval.c b/src/tmpl-expr-eval.c
index 6188877..8d29934 100644
--- a/src/tmpl-expr-eval.c
+++ b/src/tmpl-expr-eval.c
@@ -1932,6 +1932,11 @@ builtin_assert (const GValue  *value,
       if (g_value_get_float (value) == .0f)
         goto failure;
     }
+  else if (G_VALUE_HOLDS_GTYPE (value))
+    {
+      if (g_value_get_gtype (value) == G_TYPE_INVALID)
+        goto failure;
+    }
   else
     {
       goto failure;


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