Skip to content

Commit 58dd760

Browse files
authored
conversion-gen: check for nil pkg in getManualConversionFunctions
1 parent 52492e6 commit 58dd760

File tree

1 file changed

+4
-0
lines changed
  • staging/src/k8s.io/code-generator/cmd/conversion-gen/generators

1 file changed

+4
-0
lines changed

staging/src/k8s.io/code-generator/cmd/conversion-gen/generators/conversion.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ type conversionFuncMap map[conversionPair]*types.Type
145145

146146
// Returns all manually-defined conversion functions in the package.
147147
func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) {
148+
if pkg == nil {
149+
glog.Warningf("Skipping nil package passed to getManualConversionFunctions")
150+
return
151+
}
148152
glog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name)
149153

150154
scopeName := types.Ref(conversionPackagePath, "Scope").Name

0 commit comments

Comments
 (0)