From 34d7b5f515d120a80b8730dadb0a66326b8d0c4a Mon Sep 17 00:00:00 2001 From: hrxi Date: Fri, 9 Aug 2019 14:46:12 +0200 Subject: Fix Jingle connection code when `cancellable` is `null` --- xmpp-vala/src/module/xep/0166_jingle.vala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xmpp-vala/src/module') diff --git a/xmpp-vala/src/module/xep/0166_jingle.vala b/xmpp-vala/src/module/xep/0166_jingle.vala index 2e38b164..e0a96cc6 100644 --- a/xmpp-vala/src/module/xep/0166_jingle.vala +++ b/xmpp-vala/src/module/xep/0166_jingle.vala @@ -838,10 +838,15 @@ public class Connection : IOStream { return; } SourceFunc callback = wait_and_check_for_errors.callback; - ulong id = cancellable.connect(() => callback()); + ulong id = 0; + if (cancellable != null) { + id = cancellable.connect(() => callback()); + } callbacks.add(new OnSetInnerCallback() { callback=(owned)callback, io_priority=io_priority}); yield; - cancellable.disconnect(id); + if (cancellable != null) { + cancellable.disconnect(id); + } } } private void handle_connection_error(IOError error) { -- cgit v1.2.3-70-g09d2