[vala] Fix crash when using type names as conditions



commit 6dcb78ed541f363a6a03c667d8765ed4a19b59c5
Author: Jürg Billeter <j bitron ch>
Date:   Wed Apr 28 13:04:52 2010 +0200

    Fix crash when using type names as conditions

 vala/valaifstatement.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/vala/valaifstatement.vala b/vala/valaifstatement.vala
index b7c5fa1..0804bb4 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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]