Don't invoke null callbacks in network requests

This commit is contained in:
Joshua Elsasser 2019-03-09 01:36:09 -08:00 committed by Bleak Grey
parent ff72381a3f
commit bf2ae9d0bb
1 changed files with 2 additions and 1 deletions

View File

@ -97,6 +97,7 @@ public class Tootle.Network : GLib.Object {
started (); started ();
msg.finished.connect (() => { msg.finished.connect (() => {
if (msg.status_code != Soup.Status.CANCELLED) { if (msg.status_code != Soup.Status.CANCELLED) {
if (cb != null)
cb (session, msg); cb (session, msg);
msg.request_body.free (); msg.request_body.free ();
msg.response_body.free (); msg.response_body.free ();