1
0
mirror of https://github.com/nttgin/BGPalerter.git synced 2024-05-19 06:50:08 +00:00

fixed every operation on empty vrp list

This commit is contained in:
Massimo Candela
2023-01-20 12:07:32 +01:00
parent 8e3023427b
commit 8b7dba2460
2 changed files with 2 additions and 2 deletions

View File

@@ -175,7 +175,7 @@ export default class MonitorROAS extends Monitor {
const items = Object.values(uniqItems);
return {
type: items.every(i => i.type === "roa") ? "roa" : "chain",
type: !!items.length && items.every(i => i.type === "roa") ? "roa" : "chain",
expiring: items.map(i => i.file)
};
})

View File

@@ -251,7 +251,7 @@ export default class RpkiUtils {
if (results.length === 1) { // Only one result = only one origin, just return
return { ...results[0], prefix, origin };
} else { // Multiple origin
if (results.every(result => result && result.valid)) { // All valid
if (!!results.length && results.every(result => result && result.valid)) { // All valid
return {
valid: true,
covering: [].concat.apply([], results.map(i => i.covering)),