[vala] Fix a critical when using a catch block without a variable



commit b1078c562e4e510b16e3501f24fed3389dda2c0a
Author: Ali Sabil <ali sabil gmail com>
Date:   Thu Apr 16 12:35:40 2009 +0200

    Fix a critical when using a catch block without a variable
---
 gobject/valagerrormodule.vala |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gobject/valagerrormodule.vala b/gobject/valagerrormodule.vala
index 5692cac..ee93a09 100644
--- a/gobject/valagerrormodule.vala
+++ b/gobject/valagerrormodule.vala
@@ -319,8 +319,10 @@ internal class Vala.GErrorModule : CCodeDelegateModule {
 
 		var cblock = new CCodeBlock ();
 
-		string variable_name = get_variable_cname (clause.variable_name);
-		if (variable_name == null) {
+		string variable_name;
+		if (clause.variable_name != null) {
+			variable_name = get_variable_cname (clause.variable_name);
+		} else {
 			variable_name = "__err";
 		}
 



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