Browse Source

Correctly handle XML parsing errors

PR #16071.
adaptive-webui-19844
Vladimir Golovnev 3 years ago committed by GitHub
parent
commit
5f623e32c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      src/base/rss/rss_parser.cpp

10
src/base/rss/rss_parser.cpp

@ -591,16 +591,16 @@ void Parser::parse_impl(const QByteArray &feedData) @@ -591,16 +591,16 @@ void Parser::parse_impl(const QByteArray &feedData)
xml.skipCurrentElement();
}
if (!foundChannel)
{
m_result.error = tr("Invalid RSS feed.");
}
else if (xml.hasError())
if (xml.hasError())
{
m_result.error = tr("%1 (line: %2, column: %3, offset: %4).")
.arg(xml.errorString()).arg(xml.lineNumber())
.arg(xml.columnNumber()).arg(xml.characterOffset());
}
else if (!foundChannel)
{
m_result.error = tr("Invalid RSS feed.");
}
emit finished(m_result);
m_result.articles.clear(); // clear articles only

Loading…
Cancel
Save