[vala/0.6] GError: Fix uncaught errors in creation methods



commit bf98069676262e6c90ee640cbd9c914174f46f3b
Author: Jürg Billeter <j bitron ch>
Date:   Wed Apr 8 19:19:54 2009 +0200

    GError: Fix uncaught errors in creation methods
---
 gobject/valagerrormodule.vala |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gobject/valagerrormodule.vala b/gobject/valagerrormodule.vala
index 01b6e14..e443430 100644
--- a/gobject/valagerrormodule.vala
+++ b/gobject/valagerrormodule.vala
@@ -134,7 +134,9 @@ internal class Vala.GErrorModule : CCodeDelegateModule {
 		// print critical message
 		cerror_block.add_statement (cprint_frag);
 
-		if (current_return_type is VoidType) {
+		if (current_method is CreationMethod) {
+			cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("NULL")));
+		} else if (current_return_type is VoidType) {
 			cerror_block.add_statement (new CCodeReturnStatement ());
 		} else if (current_return_type != null) {
 			cerror_block.add_statement (new CCodeReturnStatement (default_value_for_type (current_return_type, false)));



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