diff --git a/dist/w3c-html-validator.d.ts b/dist/w3c-html-validator.d.ts
index 84ec4cc..7fca5c3 100644
--- a/dist/w3c-html-validator.d.ts
+++ b/dist/w3c-html-validator.d.ts
@@ -1,4 +1,4 @@
-//! w3c-html-validator v1.6.3 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
+//! w3c-html-validator v1.6.4 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
export type ValidatorSettings = {
html: string;
diff --git a/dist/w3c-html-validator.js b/dist/w3c-html-validator.js
index 47e5718..a0bbcc3 100644
--- a/dist/w3c-html-validator.js
+++ b/dist/w3c-html-validator.js
@@ -1,4 +1,4 @@
-//! w3c-html-validator v1.6.3 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
+//! w3c-html-validator v1.6.4 ~~ https://github.com/center-key/w3c-html-validator ~~ MIT License
import chalk from 'chalk';
import fs from 'fs';
@@ -6,7 +6,7 @@ import log from 'fancy-log';
import request from 'superagent';
import slash from 'slash';
const w3cHtmlValidator = {
- version: '1.6.3',
+ version: '1.6.4',
validate(options) {
const defaults = {
checkUrl: 'https://validator.w3.org/nu/',
@@ -65,8 +65,9 @@ const w3cHtmlValidator = {
const response = reason.response;
const getMsg = () => [response.status, response.res.statusMessage, response.request.url];
const message = response ? getMsg() : [reason.errno, reason.message];
- response.body = { messages: [{ type: 'network-error', message: message.join(' ') }] };
- return toValidatorResults(response);
+ const errRes = response ?? {};
+ errRes.body = { messages: [{ type: 'network-error', message: message.join(' ') }] };
+ return toValidatorResults(errRes);
};
return w3cRequest.then(filterMessages).then(toValidatorResults).catch(handleError);
},
diff --git a/package.json b/package.json
index bbe0a32..d6b722c 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "w3c-html-validator",
- "version": "1.6.3",
+ "version": "1.6.4",
"description": "Check the markup validity of HTML files using the W3C validator",
"license": "MIT",
"type": "module",