Fix NullPointerException for authMethods

This commit is contained in:
xhh
2015-07-15 09:21:09 +08:00
parent dd35c672f0
commit e5bdb3a0c1

View File

@@ -220,7 +220,7 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
bundle.put("apiFolder", config.apiPackage().replace('.', File.separatorChar));
bundle.put("modelPackage", config.modelPackage());
List<CodegenSecurity> authMethods = config.fromSecurity(swagger.getSecurityDefinitions());
if (!authMethods.isEmpty()) {
if (authMethods != null && !authMethods.isEmpty()) {
bundle.put("authMethods", authMethods);
bundle.put("hasAuthMethods", true);
}