[vala] Fix critical on invalid chain up



commit 5f512d5d8a527782ce0abf0de6a24e580b3acc0c
Author: Jürg Billeter <j bitron ch>
Date:   Fri Sep 25 20:32:02 2009 +0200

    Fix critical on invalid chain up

 vala/valamethodcall.vala |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala
index 44e9ee6..7c31f6e 100644
--- a/vala/valamethodcall.vala
+++ b/vala/valamethodcall.vala
@@ -153,7 +153,11 @@ public class Vala.MethodCall : Expression {
 			var otype = (ObjectType) mtype;
 			var cl = (Class) otype.type_symbol;
 			var base_cm = cl.default_construction_method;
-			if (!base_cm.has_construct_function) {
+			if (base_cm == null) {
+				error = true;
+				Report.error (source_reference, "chain up to `%s' not supported".printf (cl.get_full_name ()));
+				return false;
+			} else if (!base_cm.has_construct_function) {
 				error = true;
 				Report.error (source_reference, "chain up to `%s' not supported".printf (base_cm.get_full_name ()));
 				return false;



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