Skip to content

Commit 9d631f1

Browse files
committed
Fixed #660: regex match works only on strings
1 parent d8842ff commit 9d631f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/schemaUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,7 @@ module.exports = {
20902090
const regExp = new RegExp('([<\\?xml]+[\\s{1,}]+[version="\\d.\\d"]+[\\sencoding="]+.{1,15}"\\?>)');
20912091
let xmlBody = bodyContent;
20922092

2093-
if (!bodyContent.match(regExp)) {
2093+
if (!String(bodyContent).match(regExp)) {
20942094
const versionContent = '<?xml version="1.0" encoding="UTF-8"?>\n';
20952095
xmlBody = versionContent + xmlBody;
20962096
}

0 commit comments

Comments
 (0)