]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Add null check when setting the alias cname
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 5 May 2011 16:57:12 +0000 (18:57 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Thu, 5 May 2011 16:57:21 +0000 (18:57 +0200)
vala/valagirparser.vala

index c0523cce9cf8b07b9e302c3f226c60546917fbb7..65b83c2d370d96be65d59fe2ead31cb722425513 100644 (file)
@@ -2699,7 +2699,10 @@ public class Vala.GirParser : CodeVisitor {
                                st.base_type = base_type;
                        }
                        st.external = true;
-                       st.set_cname (alias.girdata["c:type"]);
+                       var cname = alias.girdata["c:type"];
+                       if (cname != null) {
+                               st.set_cname (cname);
+                       }
                        if (simple_type) {
                                st.set_simple_type (true);
                        }
@@ -2711,7 +2714,10 @@ public class Vala.GirParser : CodeVisitor {
                                cl.add_base_type (base_type);
                        }
                        cl.external = true;
-                       cl.set_cname (alias.girdata["c:type"]);
+                       var cname = alias.girdata["c:type"];
+                       if (cname != null) {
+                               cl.set_cname (cname);
+                       }
                        alias.symbol = cl;
                }
        }