diff --git a/tools/doc/html.js b/tools/doc/html.js
index 49be0ce36fe6fd..9b6d93b7a7bb1c 100644
--- a/tools/doc/html.js
+++ b/tools/doc/html.js
@@ -175,11 +175,9 @@ function replaceInText(text) {
}
function altDocs(filename) {
- let html = '';
-
if (!docCreated) {
console.error(`Failed to add alternative version links to ${filename}`);
- return html;
+ return '';
}
function lte(v) {