Skip to content

Commit

Permalink
zimcheck: Test if the link is empty before testing its content.
Browse files Browse the repository at this point in the history
Fix #279
  • Loading branch information
mgautierfr committed Jan 13, 2022
1 parent a26a450 commit 04dedc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zimcheck/checks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,13 @@ void ArticleChecker::check_internal_links(zim::Item item, const LinkCollection&
int nremptylinks = 0;
for (const auto &l : links)
{
if (l.link.front() == '#' || l.link.front() == '?') continue;
if (l.isInternalUrl() == false) continue;
if (l.link.empty())
{
nremptylinks++;
continue;
}
if (l.link.front() == '#' || l.link.front() == '?') continue;
if (l.isInternalUrl() == false) continue;


if (isOutofBounds(l.link, baseUrl))
Expand Down

0 comments on commit 04dedc6

Please sign in to comment.