Skip to content

Commit d7edb43

Browse files
authored
Merge pull request #718 from aman-v-singh/fix/IMPORT-1029-type-error-openapi-3-0-cannot-read-properties-of-null-reading-match
[FIX/IMPORT-1029] - Checking typeof bodyContent in getXmlVersionContent
2 parents b010216 + e4b5d96 commit d7edb43

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/schemaUtils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2097,6 +2097,7 @@ module.exports = {
20972097
}
20982098
else {
20992099
let getXmlVersionContent = (bodyContent) => {
2100+
bodyContent = (typeof bodyContent === 'string') ? bodyContent : '';
21002101
const regExp = new RegExp('([<\\?xml]+[\\s{1,}]+[version="\\d.\\d"]+[\\sencoding="]+.{1,15}"\\?>)');
21012102
let xmlBody = bodyContent;
21022103

0 commit comments

Comments
 (0)