X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fcommon%2Feniro.cpp;h=edffeedb3695b6303a6bd5176fda8e9e63526d69;hb=40f8e10e1efc5019011df940328cdc734576143d;hp=46fda30047c773b80b7a50810ba96a464d5c5f36;hpb=d93782e7a5ae0fc072d094fd645cf415a34a2244;p=jenirok diff --git a/src/common/eniro.cpp b/src/common/eniro.cpp index 46fda30..edffeed 100644 --- a/src/common/eniro.cpp +++ b/src/common/eniro.cpp @@ -201,6 +201,13 @@ void Eniro::handleHttpData(int id, QByteArray const& data) if((searchIt = pendingSearches_.find(id)) != pendingSearches_.end()) { + if(data.isEmpty()) + { + setError(CONNECTION_FAILURE, "Server returned empty data"); + emitRequestFinished(id, searchIt.value(), true); + return; + } + // Load results from html data loadResults(id, data); } @@ -209,6 +216,13 @@ void Eniro::handleHttpData(int id, QByteArray const& data) else if((numberIt = pendingNumberRequests_.find(id)) != pendingNumberRequests_.end()) { + if(data.isEmpty()) + { + setError(CONNECTION_FAILURE, "Server returned empty data"); + emitRequestFinished(id, searchIt.value(), true); + return; + } + // Load number from html data loadNumber(id, data); }