]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
fix crash when data_type property is null
authorJuerg Billeter <j@bitron.ch>
Wed, 9 Jan 2008 22:21:33 +0000 (22:21 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 9 Jan 2008 22:21:33 +0000 (22:21 +0000)
2008-01-09  Juerg Billeter  <j@bitron.ch>

* vala/valadatatype.vala: fix crash when data_type property is null

svn path=/trunk/; revision=817

ChangeLog
vala/valadatatype.vala

index ad9f31585823727a9df2ff53f5b84f9b8a722d52..8f0729342060608e6014e0c478cb1695eb20dd90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-09  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valadatatype.vala: fix crash when data_type property is null
+
 2008-01-09  Jürg Billeter  <j@bitron.ch>
 
        * vapi/glib-2.0.vapi: minor fixes
index 18db2e293ddddc59b210302f92d53a7bf02f5424..7a38974f072d8a303a05244e19e4b2da096bc4b8 100644 (file)
@@ -344,10 +344,11 @@ public class Vala.DataType : CodeNode {
                if (target_type is PointerType || (target_type.data_type != null && target_type.data_type.get_attribute ("PointerType") != null)) {
                        /* any reference or array type or pointer type can be cast to a generic pointer */
                        if (type_parameter != null ||
-                               data_type.is_reference_type () ||
-                               data_type is Array ||
-                               data_type is Callback ||
-                               data_type.get_attribute ("PointerType") != null) {
+                               (data_type != null && (
+                                       data_type.is_reference_type () ||
+                                       data_type is Array ||
+                                       data_type is Callback ||
+                                       data_type.get_attribute ("PointerType") != null))) {
                                return true;
                        }