Created by: delenius
PR checklist
-
Read the contribution guidelines. -
Ran the shell script under ./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\. -
Filed the PR against the correct branch: Default: master. -
Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
Description of the PR
After switching from swagger-codegen to openapi-generator, I got NPEs from a couple of places in DefaultCodegen.java. This PR adds defensive programming null checks in two places, which fixes the problem for me.
My spec is very large, and it would be time-consuming to isolate the exact problem; perhaps the experts around here can figure it out from looking at the code.