In some cases, QNetworkReplyHandler's m_reply holds an empty url. m_reply->url(); <--- empty. it happend for example in some non-successful page loads. e.g. if one do: <quote> frame>setUrl("http://any.thing.invalid.here/"); <quote/> When it happens, the ResourceError passed up to FrameLoadClientQt by QNetworkReplyHandle::finish (via MainResourceLoader -> DocumentLoader -> FrameLoader) will fill ErrorPageExtensionOption's url field with an empty url. it might not be a helpful situation for client application handling error pages ...
Created attachment 40875 [details] patch 0.1
Comment on attachment 40875 [details] patch 0.1 > - QUrl url = m_reply->url(); > + QUrl url = (m_reply->url().toString().isNull()) ? m_request.url(): m_reply->url(); Instead of converting the url to a QString first before checking if it's null, can you call isEmpty() on QUrl instead? I.e. QUrl url = m_reply->url(); if (url.isEmpty()) url = m_request.url(); Is there any way to write a unit test for this? :)
thx for your comments, simon. > Instead of converting the url to a QString first before checking if it's null, > can you call isEmpty() on QUrl instead? sure thing. > I.e. > > QUrl url = m_reply->url(); > if (url.isEmpty()) > url = m_request.url(); ok > Is there any way to write a unit test for this? :) i will try to get a auto test for it, before a next iteration here ...
never mind. I just tried it again, and it works fine now