Skip to content

Commit

Permalink
Merge pull request #464 from metrico/fix/463
Browse files Browse the repository at this point in the history
fix: labels presence check
  • Loading branch information
akvlad authored Feb 13, 2024
2 parents 3d2ab02 + 19f8aa8 commit 7028774
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module.exports.neqExtraLabels = (token/*, query */) => {
*/
module.exports.neqStream = (token/*, query */) => {
const [label, value] = labelAndVal(token)
return (e) => isEOF(e) || (e && e.labels[label] && e.labels[label] !== value)
return (e) => isEOF(e) || (e && e.labels && e.labels[label] && e.labels[label] !== value)
}

/**
Expand Down Expand Up @@ -159,7 +159,7 @@ module.exports.nregExtraLabels = (token/*, query */) => {
module.exports.nregStream = (token/*, query */) => {
const [label, value] = labelAndVal(token)
const re = new RegExp(value)
return (e) => isEOF(e) || (e && e.labels[label] && !e.labels[label].match(re))
return (e) => isEOF(e) || (e && e.labels && e.labels[label] && !e.labels[label].match(re))
}

/**
Expand Down

0 comments on commit 7028774

Please sign in to comment.