From: Rico Tzschichholz Date: Mon, 22 Oct 2012 11:16:39 +0000 (+0200) Subject: Report error for unsupported GVariant (de)serialization X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e33e2b5ec2dfeaf60daf5890575fd9e258c9b3;p=thirdparty%2Fvala.git Report error for unsupported GVariant (de)serialization --- diff --git a/codegen/valagvarianttransformer.vala b/codegen/valagvarianttransformer.vala index 2114e67ca..8d0f1b923 100644 --- a/codegen/valagvarianttransformer.vala +++ b/codegen/valagvarianttransformer.vala @@ -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);