diff --git a/lib/indexHelpers.js b/lib/indexHelpers.js index 612dd41..a918ab2 100644 --- a/lib/indexHelpers.js +++ b/lib/indexHelpers.js @@ -160,7 +160,8 @@ const storeReadmeInJsonIfExists = (modulePath, currentExtendedPackageJson) => { typeof modulePath !== 'string' || typeof currentExtendedPackageJson !== 'object' || modulePath === '' || - currentExtendedPackageJson?.readme?.toLowerCase()?.indexOf('no readme data found') === -1 + (typeof currentExtendedPackageJson?.readme === 'string' && + currentExtendedPackageJson?.readme?.toLowerCase()?.indexOf('no readme data found') === -1) ) { return; }