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:
@@ -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)
|
||||
};
|
||||
})
|
||||
|
@@ -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)),
|
||||
|
Reference in New Issue
Block a user