1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

[PageFormCompleter] Try to be extra cautious with QWebFrames

This is an attempt to fix crash when calling QWebFrame::childFrames
in PageFormCompleter::getAllElementsFromPage

[ci skip]
This commit is contained in:
nowrep 2014-04-06 15:13:07 +02:00
parent 39c9fec3dd
commit 6e18ee7502

View File

@ -233,15 +233,15 @@ QWebElementCollection PageFormCompleter::getAllElementsFromPage(const QString &s
{
QWebElementCollection list;
if (!m_page) {
if (!m_page || !m_page->mainFrame())
return list;
}
QList<QWebFrame*> frames;
frames.append(m_page->mainFrame());
while (!frames.isEmpty()) {
QWebFrame* frame = frames.takeFirst();
if (frame) {
if (frame && !frame->documentElement().isNull()) {
list.append(frame->findAllElements(selector));
frames += frame->childFrames();
}