Skip to content

Commit

Permalink
Merge pull request #202 from xmidt-org/denopink/patch/mocktr181-empty…
Browse files Browse the repository at this point in the history
…-name-panics-GET

patch: empty names field causes mockt181's GET to panic
  • Loading branch information
denopink authored Jul 29, 2024
2 parents bb0db20 + 1a60019 commit 850efb6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/wrphandlers/mocktr181/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ func (h Handler) get(tr181 *Tr181Payload) (int64, []byte, error) {
for _, name := range tr181.Names {
var found bool
for _, mockParameter := range h.parameters {
if name == "" {
continue
}

if !strings.HasPrefix(mockParameter.Name, name) {
continue
}
Expand Down

0 comments on commit 850efb6

Please sign in to comment.