]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girwriter: Fix crash in attribute handling
authorJürg Billeter <j@bitron.ch>
Thu, 16 Sep 2010 15:32:53 +0000 (17:32 +0200)
committerJürg Billeter <j@bitron.ch>
Thu, 16 Sep 2010 15:32:53 +0000 (17:32 +0200)
Fixes bug 629364.

codegen/valagirwriter.vala

index 4890aa650bb12072df7e35c0432e8ebf2a1f0705..b1849478e98ffbd02a90ff2fe4525dad0858a19d 100644 (file)
@@ -882,15 +882,11 @@ public class Vala.GIRWriter : CodeVisitor {
                foreach (Attribute attr in node.attributes) {
                        string name = camel_case_to_canonical (attr.name);
                        foreach (string arg_name in attr.args.get_keys ()) {
-                               var arg = attr.args.get (arg_name);
+                               string value = attr.args.get (arg_name);
 
-                               string value = literal_expression_to_value_string ((Literal) arg);
-
-                               if (value != null) {
-                                       write_indent ();
-                                       buffer.append_printf ("<annotation key=\"%s.%s\" value=\"%s\"/>\n",
-                                               name, camel_case_to_canonical (arg_name), value);
-                               }
+                               write_indent ();
+                               buffer.append_printf ("<annotation key=\"%s.%s\" value=\"%s\"/>\n",
+                                       name, camel_case_to_canonical (arg_name), value);
                        }
                }
        }