From 04dedc65956e548377a6c45647d83a3c6aee891a Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 13 Jan 2022 15:16:11 +0100 Subject: [PATCH] zimcheck: Test if the link is empty before testing its content. Fix #279 --- src/zimcheck/checks.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zimcheck/checks.cpp b/src/zimcheck/checks.cpp index 3515ca53..3f72ea04 100644 --- a/src/zimcheck/checks.cpp +++ b/src/zimcheck/checks.cpp @@ -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))