conversion-gen: check for nil pkg in getManualConversionFunctions

This commit is contained in:
James Munnelly 2017-11-17 15:45:18 +00:00 committed by GitHub
parent 52492e683f
commit 58dd760c66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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