Skip to content

Commit 3ce8af3

Browse files
authored
Fix: Add defensive code to getType (fixes #229)
1 parent bc02002 commit 3ce8af3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/integration/Plugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,10 @@ export default class Plugin {
336336
async getType () {
337337
if (this._type) return this._type
338338
const info = await this.getInfo()
339+
if (!info) return null
339340
const foundAttributeType = PLUGIN_TYPES.find(type => info[type])
340341
const foundKeywordType = info.keywords
341-
.map(keyword => {
342+
?.map(keyword => {
342343
const typematches = PLUGIN_TYPES.filter(type => keyword?.toLowerCase()?.includes(type))
343344
return typematches.length ? typematches[0] : null
344345
})

0 commit comments

Comments
 (0)