]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix crash when using type names as conditions
authorJürg Billeter <j@bitron.ch>
Wed, 28 Apr 2010 11:04:52 +0000 (13:04 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 28 Apr 2010 11:04:52 +0000 (13:04 +0200)
vala/valaifstatement.vala

index b7c5fa10686e22d6e0728db501a296270de9462d..0804bb466339f2804a240bac296e8ed582d12f94 100644 (file)
@@ -124,7 +124,7 @@ public class Vala.IfStatement : CodeNode, Statement {
                        return false;
                }
 
-               if (!condition.value_type.compatible (analyzer.bool_type)) {
+               if (condition.value_type == null || !condition.value_type.compatible (analyzer.bool_type)) {
                        error = true;
                        Report.error (condition.source_reference, "Condition must be boolean");
                        return false;