[vala] GError: Fix uncaught errors in creation methods



commit 1d46739d3934d744ccece0027d50bf4a6603cc89
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 7869130..6fa5c73 100644
--- a/gobject/valagerrormodule.vala
+++ b/gobject/valagerrormodule.vala
@@ -149,7 +149,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]