From 6c90c04fb94ea229a5b7d2328fe1b6b3da99d2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Wed, 25 Jan 2023 12:31:12 +0100 Subject: [PATCH] Torrent example: don't try to announce to an empty URL Task-number: QTBUG-109798 Task-number: QTBUG-110622 Pick-to: 6.5 Change-Id: I3603232eb094387388da6421bf5525a3ba54fe03 Reviewed-by: Thiago Macieira --- examples/network/torrent/trackerclient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/network/torrent/trackerclient.cpp b/examples/network/torrent/trackerclient.cpp index fc1849c221..077696ccd8 100644 --- a/examples/network/torrent/trackerclient.cpp +++ b/examples/network/torrent/trackerclient.cpp @@ -54,6 +54,8 @@ void TrackerClient::timerEvent(QTimerEvent *event) void TrackerClient::fetchPeerList() { + if (metaInfo.announceUrl().isEmpty()) + return; QUrl url(metaInfo.announceUrl()); // Base the query on announce url to include a passkey (if any)