diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-26 00:38:46 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-26 00:38:46 +0200 |
commit | d86c5bfb0f9e627a0d1dfc37b7d128fd4e60afeb (patch) | |
tree | b7b5608349b319d8abf8e43f6fd0b88e0bad4064 /src | |
parent | Merge branch 'NetworkRequestImprovements' (diff) | |
download | rekonq-d86c5bfb0f9e627a0d1dfc37b7d128fd4e60afeb.tar.xz |
Fix crash
BUG: 231060
Diffstat (limited to 'src')
-rw-r--r-- | src/protocolhandler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index c97bc475..b88f23fa 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -213,20 +213,20 @@ QString ProtocolHandler::dirHandling(const KFileItemList &list) } KFileItem mainItem = _lister->rootItem(); - KUrl rootUrl = mainItem.url(); - if (mainItem.isNull()) { - QString errStr = i18nc("%1=an URL", "Error opening '%1': No such file or directory.", rootUrl.prettyUrl() ); + QString errStr = i18nc("%1=an URL", "Error opening '%1': No such file or directory.", _url.prettyUrl() ); return errStr; } - + if (!mainItem.isReadable()) { - QString errStr = i18nc("%1=an URL", "Unable to read %1", rootUrl.prettyUrl() ); + QString errStr = i18nc("%1=an URL", "Unable to read %1", _url.prettyUrl() ); return errStr; } + KUrl rootUrl = mainItem.url(); + // display "rekonq info" page QString infoFilePath = KStandardDirs::locate("data", "rekonq/htmls/rekonqinfo.html"); QFile file(infoFilePath); @@ -292,7 +292,7 @@ QString ProtocolHandler::dirHandling(const KFileItemList &list) void ProtocolHandler::showResults(const KFileItemList &list) { - if(_lister->rootItem().isFile()) + if(!_lister->rootItem().isNull() && _lister->rootItem().isReadable() && _lister->rootItem().isFile()) { WebPage *page = qobject_cast<WebPage *>( _frame->page() ); page->downloadUrl( _lister->rootItem().url() ); |