aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dbusbind.c11
-rw-r--r--test/automated/dbus-tests.el1
2 files changed, 10 insertions, 2 deletions
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 9747d88a5a9..63f46726455 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1683,7 +1683,16 @@ xd_build_message (Lisp_Object caller, struct xd_message *xmessage,
1683 { 1683 {
1684 if (EQ (args[count], QCdbus_type_type)) 1684 if (EQ (args[count], QCdbus_type_type))
1685 { 1685 {
1686 xd_append_arg_with_type_spec (args[count+1], args[count+2], &iter); 1686 /* At least one object must follow the `:type' symbol. */
1687 if (!(count+1 < nargs))
1688 wrong_type_argument (intern ("D-Bus"), QCdbus_type_type);
1689
1690 /* It is possible that no argument follows a type
1691 specification, when the type is an empty compound type.
1692 Assume it as nil. */
1693 xd_append_arg_with_type_spec (args[count+1],
1694 count+2 < nargs ? args[count+2] : Qnil,
1695 &iter);
1687 count += 2; 1696 count += 2;
1688 } 1697 }
1689 else 1698 else
diff --git a/test/automated/dbus-tests.el b/test/automated/dbus-tests.el
index 69afaa324f7..e989f73e68c 100644
--- a/test/automated/dbus-tests.el
+++ b/test/automated/dbus-tests.el
@@ -214,7 +214,6 @@ This includes initialization and closing the bus."
214 (should (equal (plist-get message :args) '(((:array nil) nil)))) 214 (should (equal (plist-get message :args) '(((:array nil) nil))))
215 (should (equal (plist-get message :signature) "au")) 215 (should (equal (plist-get message :signature) "au"))
216 ;; Test explicit type specifications with `:type' keyword for empty array. 216 ;; Test explicit type specifications with `:type' keyword for empty array.
217 ;; DOES THIS WORK?
218 (setq message (dbus--test-create-message-with-args 217 (setq message (dbus--test-create-message-with-args
219 :type '(:array :uint32))) 218 :type '(:array :uint32)))
220 (should (equal (plist-get message :args) '(((:array nil) nil)))) 219 (should (equal (plist-get message :args) '(((:array nil) nil))))