[vala] D-Bus: Report error when trying to create proxy for non-D-Bus interface



commit 38ec133f8036a2f6fd2505520898508842437180
Author: Jürg Billeter <j bitron ch>
Date:   Sun Jun 20 12:32:03 2010 +0200

    D-Bus: Report error when trying to create proxy for non-D-Bus interface
    
    Fixes bug 603494.

 codegen/valagdbusclientmodule.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valagdbusclientmodule.vala b/codegen/valagdbusclientmodule.vala
index 673e792..170196a 100644
--- a/codegen/valagdbusclientmodule.vala
+++ b/codegen/valagdbusclientmodule.vala
@@ -245,6 +245,12 @@ public class Vala.GDBusClientModule : GDBusModule {
 		var type_arg = (ObjectType) ma.get_type_arguments ().get (0);
 		var iface = (Interface) type_arg.type_symbol;
 
+		string dbus_iface_name = get_dbus_name (iface);
+		if (dbus_iface_name == null) {
+			Report.error (expr.source_reference, "`%s' is not a D-Bus interface".printf (iface.get_full_name ()));
+			return;
+		}
+
 		var args = expr.get_argument_list ();
 		Expression bus_type = args.get (0);
 		Expression name = args.get (1);



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