[vala] D-Bus: Fix criticals when using generic errors



commit f1428b098a2097b269e2dfefae590e3453264594
Author: Jürg Billeter <j bitron ch>
Date:   Fri Mar 26 17:58:10 2010 +0100

    D-Bus: Fix criticals when using generic errors

 codegen/valadbusclientmodule.vala |    5 +++++
 codegen/valadbusservermodule.vala |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valadbusclientmodule.vala b/codegen/valadbusclientmodule.vala
index 7d4e4c1..18c78f8 100644
--- a/codegen/valadbusclientmodule.vala
+++ b/codegen/valadbusclientmodule.vala
@@ -1841,6 +1841,11 @@ internal class Vala.DBusClientModule : DBusModule {
 		foreach (DataType error_type in error_types) {
 			var edomain = ((ErrorType) error_type).error_domain;
 
+			if (edomain == null) {
+				Report.error (error_type.source_reference, "Generic errors cannot be serialized over DBus");
+				continue;
+			}
+
 			var edomain_dbus_name = get_dbus_name (edomain);
 			if (edomain_dbus_name == null) {
 				Report.error (edomain.source_reference, "Errordomain must have a DBus.name annotation to be serialized over DBus");
diff --git a/codegen/valadbusservermodule.vala b/codegen/valadbusservermodule.vala
index 64de305..1b7a28e 100644
--- a/codegen/valadbusservermodule.vala
+++ b/codegen/valadbusservermodule.vala
@@ -432,6 +432,11 @@ internal class Vala.DBusServerModule : DBusClientModule {
 		foreach (DataType error_type in error_types) {
 			var edomain = ((ErrorType) error_type).error_domain;
 
+			if (edomain == null) {
+				Report.error (error_type.source_reference, "Generic errors cannot be serialized over DBus");
+				continue;
+			}
+
 			var edomain_dbus_name = get_dbus_name (edomain);
 			if (edomain_dbus_name == null) {
 				Report.error (edomain.source_reference, "Errordomain must have a DBus.name annotation to be serialized over DBus");



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