From 452a565ea2e5fdc7e6c498ec17bf1dd55a40ee1e Mon Sep 17 00:00:00 2001
From: Daniel Molkentin <daniel.molkentin@nokia.com>
Date: Mon, 10 Aug 2009 11:41:28 +0200
Subject: [PATCH] Do not crash on some system when no proxy is set

---
 src/plugins/welcome/rssfetcher.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/welcome/rssfetcher.cpp b/src/plugins/welcome/rssfetcher.cpp
index 7254c2d00b9..e0848a79695 100644
--- a/src/plugins/welcome/rssfetcher.cpp
+++ b/src/plugins/welcome/rssfetcher.cpp
@@ -120,7 +120,9 @@ RSSFetcher::RSSFetcher(int maxItems, QObject *parent)
 
 void RSSFetcher::fetch(const QUrl &url)
 {
-    m_http.setProxy(QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(url)).first());
+    QList<QNetworkProxy> proxies = QNetworkProxyFactory::systemProxyForQuery(QNetworkProxyQuery(url));
+    if (proxies.count() > 0)
+        m_http.setProxy(proxies.first());
     m_http.setHost(url.host());
     QString agentStr = QString("Qt-Creator/%1 (QHttp %2; %3; %4; %5 bit)")
                     .arg(Core::Constants::IDE_VERSION_LONG).arg(qVersion())
-- 
GitLab