mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +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;
|
||||
|
||||
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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user