From 792cc1b55106d1700605bcf59e6e76caf6efbba1 Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Fri, 17 Nov 2017 15:45:18 +0000 Subject: [PATCH] conversion-gen: check for nil pkg in getManualConversionFunctions Kubernetes-commit: 58dd760c66a448ca1f26bb90a1a82707d2a7a252 --- cmd/conversion-gen/generators/conversion.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/conversion-gen/generators/conversion.go b/cmd/conversion-gen/generators/conversion.go index e4adff5d..b7849505 100644 --- a/cmd/conversion-gen/generators/conversion.go +++ b/cmd/conversion-gen/generators/conversion.go @@ -145,6 +145,10 @@ type conversionFuncMap map[conversionPair]*types.Type // Returns all manually-defined conversion functions in the package. func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) { + if pkg == nil { + glog.Warningf("Skipping nil package passed to getManualConversionFunctions") + return + } glog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name) scopeName := types.Ref(conversionPackagePath, "Scope").Name