From 6dcb78ed541f363a6a03c667d8765ed4a19b59c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Wed, 28 Apr 2010 13:04:52 +0200 Subject: [PATCH] Fix crash when using type names as conditions --- vala/valaifstatement.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vala/valaifstatement.vala b/vala/valaifstatement.vala index b7c5fa106..0804bb466 100644 --- a/vala/valaifstatement.vala +++ b/vala/valaifstatement.vala @@ -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; -- 2.47.3