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 ad9f315..8f07293 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 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
 
 2008-01-09  Jürg Billeter  <j@bitron.ch>
index 18db2e2..7a38974 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;
                        }