diff --git a/src/core/kprotocolmanager.cpp b/src/core/kprotocolmanager.cpp --- a/src/core/kprotocolmanager.cpp +++ b/src/core/kprotocolmanager.cpp @@ -1135,6 +1135,9 @@ bool KProtocolManager::isSourceProtocol(const QUrl &url) { + if (!url.isValid()) { + return false; + } KProtocolInfoPrivate *prot = findProtocol(url); if (!prot) { return false; @@ -1145,6 +1148,9 @@ bool KProtocolManager::supportsListing(const QUrl &url) { + if (!url.isValid()) { + return false; + } KProtocolInfoPrivate *prot = findProtocol(url); if (!prot) { return false; diff --git a/src/widgets/kurlcompletion.cpp b/src/widgets/kurlcompletion.cpp --- a/src/widgets/kurlcompletion.cpp +++ b/src/widgets/kurlcompletion.cpp @@ -623,6 +623,10 @@ KUrlCompletionPrivate::MyURL url(text, d->cwd); + if (!url.kurl().isValid()) { + return QString(); + } + d->compl_text = text; // Set d->prepend to the original URL, with the filename [and ref/query] stripped.