diff options
Diffstat (limited to '_dbus_bindings/conn-methods.c')
-rw-r--r-- | _dbus_bindings/conn-methods.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/_dbus_bindings/conn-methods.c b/_dbus_bindings/conn-methods.c index dae1816..d4d031b 100644 --- a/_dbus_bindings/conn-methods.c +++ b/_dbus_bindings/conn-methods.c @@ -403,6 +403,13 @@ Connection_send_message_with_reply(Connection *self, PyObject *args, PyObject *k return PyErr_NoMemory(); } + if (!pending) { + /* connection is disconnected (doesn't return FALSE!) */ + PyErr_SetString (DBusPyException, "Connection is disconnected - " + "unable to make method call"); + return NULL; + } + return DBusPyPendingCall_ConsumeDBusPendingCall(pending, callable); } |