]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
D-Bus: Fix criticals when using generic errors
authorJürg Billeter <j@bitron.ch>
Fri, 26 Mar 2010 16:58:10 +0000 (17:58 +0100)
committerJürg Billeter <j@bitron.ch>
Fri, 26 Mar 2010 16:58:10 +0000 (17:58 +0100)
codegen/valadbusclientmodule.vala
codegen/valadbusservermodule.vala

index 7d4e4c11b4ff8153fb3c94e40a08514208d071e0..18c78f80eef1af3fda431ce2914658371d4a83f2 100644 (file)
@@ -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");
index 64de305af741ad56cbdadc77d2556930ce3cbc8d..1b7a28eada4827f0431960a65a815c65928a15ce 100644 (file)
@@ -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");