mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-07 16:15:32 +02:00
fix potential infinite loop
This commit is contained in:
parent
6a58e45c7a
commit
a356ced646
1 changed files with 1 additions and 1 deletions
|
@ -355,7 +355,7 @@ impl Readability {
|
|||
// The scores shouldn't get too low.
|
||||
let score_threshold = last_score / 3.0;
|
||||
|
||||
while !Util::has_tag_name(parent_of_top_candidate.as_ref(), "BODY") {
|
||||
while parent_of_top_candidate.is_some() && !Util::has_tag_name(parent_of_top_candidate.as_ref(), "BODY") {
|
||||
if parent_of_top_candidate
|
||||
.as_ref()
|
||||
.map(|n| Self::get_content_score(n).is_none())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue