diff --git a/simgear/io/HTTPClient.cxx b/simgear/io/HTTPClient.cxx index eab0258c..fe6fa737 100644 --- a/simgear/io/HTTPClient.cxx +++ b/simgear/io/HTTPClient.cxx @@ -242,8 +242,13 @@ void Client::makeRequest(const Request_ptr& r) if( r->isComplete() ) return; + if (r->url().empty()) { + r->setFailure(EINVAL, "no URL specified on request"); + return; + } + if( r->url().find("://") == std::string::npos ) { - r->setFailure(EINVAL, "malformed URL"); + r->setFailure(EINVAL, "malformed URL: '" + r->url() + "'"); return; } diff --git a/simgear/package/Root.cxx b/simgear/package/Root.cxx index 226e632e..d7e06b4f 100644 --- a/simgear/package/Root.cxx +++ b/simgear/package/Root.cxx @@ -778,6 +778,11 @@ bool Root::removeCatalogById(const std::string& aId) void Root::requestThumbnailData(const std::string& aUrl) { + if (aUrl.empty()) { + SG_LOG(SG_GENERAL, SG_DEV_WARN, "requestThumbnailData: empty URL requested"); + return; + } + auto it = d->thumbnailCache.find(aUrl); if (it == d->thumbnailCache.end()) { bool cachedOnDisk = d->checkPersistentCache(aUrl);