]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error for unsupported GVariant (de)serialization
authorRico Tzschichholz <ricotz@t-online.de>
Mon, 22 Oct 2012 11:16:39 +0000 (13:16 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 11 Mar 2019 12:52:38 +0000 (13:52 +0100)
codegen/valagvarianttransformer.vala

index 2114e67cac0730a13acdb71949280416fa8b3d3a..8d0f1b9236412f271676c18f2135532457543fb5 100644 (file)
@@ -522,6 +522,10 @@ public class Vala.GVariantTransformer : CCodeTransformer {
                        result = deserialize_hash_table ((ObjectType) type, expr.inner);
                }
 
+               if (result == null) {
+                       Report.error (type.source_reference, "GVariant deserialization of type `%s' is not supported".printf (type.to_string ()));
+               }
+
                context.analyzer.replaced_nodes.add (expr.inner);
                expr.inner = result;
                b.check (this);
@@ -561,6 +565,10 @@ public class Vala.GVariantTransformer : CCodeTransformer {
                        result = serialize_hash_table ((ObjectType) type, expr);
                }
 
+               if (result == null) {
+                       Report.error (type.source_reference, "GVariant serialization of type `%s' is not supported".printf (type.to_string ()));
+               }
+
                result.target_type = target_type;
                context.analyzer.replaced_nodes.add (expr);
                old_parent_node.replace_expression (expr, result);