Fix panic if selector uses malformed syntax

This commit is contained in:
Martin Nagy 2015-01-14 17:07:05 +01:00
parent 1f210d4961
commit 9340781d21

View File

@ -166,6 +166,7 @@ func (b *Builder) SelectorParam(s string) *Builder {
selector, err := labels.ParseSelector(s)
if err != nil {
b.errs = append(b.errs, fmt.Errorf("the provided selector %q is not valid: %v", s, err))
return b
}
if selector.Empty() {
return b