diff options
Diffstat (limited to 'xmpp-vala/src/module/xep/0199_ping.vala')
-rw-r--r-- | xmpp-vala/src/module/xep/0199_ping.vala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmpp-vala/src/module/xep/0199_ping.vala b/xmpp-vala/src/module/xep/0199_ping.vala index 3b11bd73..6cb3b4ba 100644 --- a/xmpp-vala/src/module/xep/0199_ping.vala +++ b/xmpp-vala/src/module/xep/0199_ping.vala @@ -8,7 +8,7 @@ namespace Xmpp.Xep.Ping { public class Module : XmppStreamModule { public static ModuleIdentity<Module> IDENTITY = new ModuleIdentity<Module>(NS_URI, "0199_ping"); - public void send_ping(XmppStream stream, string jid, ResponseListener listener) { + public void send_ping(XmppStream stream, string jid, ResponseListener? listener) { Iq.Stanza iq = new Iq.Stanza.get(new StanzaNode.build("ping", NS_URI).add_self_xmlns()); iq.to = jid; stream.get_module(Iq.Module.IDENTITY).send_iq(stream, iq, on_ping_response, listener); @@ -35,9 +35,9 @@ namespace Xmpp.Xep.Ping { public void on_iq_set(XmppStream stream, Iq.Stanza iq) { } } - private static void on_ping_response(XmppStream stream, Iq.Stanza iq, Object o) { - ResponseListener listener = o as ResponseListener; - listener.on_result(stream); + private static void on_ping_response(XmppStream stream, Iq.Stanza iq, Object? o) { + ResponseListener? listener = o as ResponseListener; + if (listener != null) listener.on_result(stream); } } |