From 0850ceb2720afa735efbeb498e9aa6cb0b90ef64 Mon Sep 17 00:00:00 2001 From: Dave Shanley Date: Mon, 27 Feb 2023 10:53:20 -0500 Subject: [PATCH] added null check for paramRef when scanning operation params. this issue was discovered in https://github.com/daveshanley/vacuum/issues/240, this provides a resolution to the problem. --- index/utility_methods.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index/utility_methods.go b/index/utility_methods.go index 0576495..c8c1658 100644 --- a/index/utility_methods.go +++ b/index/utility_methods.go @@ -302,8 +302,10 @@ func (index *SpecIndex) scanOperationParams(params []*yaml.Node, pathItemNode *y Path: path, }) } else { - index.paramOpRefs[pathItemNode.Value][method][paramRefName] = - append(index.paramOpRefs[pathItemNode.Value][method][paramRefName], paramRef) + if paramRef != nil { + index.paramOpRefs[pathItemNode.Value][method][paramRefName] = + append(index.paramOpRefs[pathItemNode.Value][method][paramRefName], paramRef) + } } continue