mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 18:56:34 +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:
parent
39c9fec3dd
commit
6e18ee7502
@ -233,15 +233,15 @@ QWebElementCollection PageFormCompleter::getAllElementsFromPage(const QString &s
|
|||||||
{
|
{
|
||||||
QWebElementCollection list;
|
QWebElementCollection list;
|
||||||
|
|
||||||
if (!m_page) {
|
if (!m_page || !m_page->mainFrame())
|
||||||
return list;
|
return list;
|
||||||
}
|
|
||||||
|
|
||||||
QList<QWebFrame*> frames;
|
QList<QWebFrame*> frames;
|
||||||
frames.append(m_page->mainFrame());
|
frames.append(m_page->mainFrame());
|
||||||
|
|
||||||
while (!frames.isEmpty()) {
|
while (!frames.isEmpty()) {
|
||||||
QWebFrame* frame = frames.takeFirst();
|
QWebFrame* frame = frames.takeFirst();
|
||||||
if (frame) {
|
if (frame && !frame->documentElement().isNull()) {
|
||||||
list.append(frame->findAllElements(selector));
|
list.append(frame->findAllElements(selector));
|
||||||
frames += frame->childFrames();
|
frames += frame->childFrames();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user