Skip to content

Commit 0cb33c8

Browse files
PendaGTPdecyjphr
andauthored
fix: prevent error on null input in appendToResults (#747)
Co-authored-by: Yadhav Jayaraman <[email protected]>
1 parent 5462d65 commit 0cb33c8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/settings.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -856,13 +856,15 @@ ${this.results.reduce((x, y) => {
856856
}
857857
}
858858

859-
appendToResults(res) {
860-
if (this.nop) {
861-
//Remove nulls and undefined from the results
862-
const results = res.flat(3).filter(r => r)
863-
864-
this.results = this.results.concat(results)
859+
appendToResults (res) {
860+
if (!this.nop || !res) {
861+
return
865862
}
863+
864+
const input = (!Array.isArray(res) && this.isObject(res)) ? [res] : res
865+
const results = input.flat(3).filter(Boolean)
866+
867+
this.results = this.results.concat(results)
866868
}
867869

868870
async getReposForTeam(teamslug) {

0 commit comments

Comments
 (0)