Skip to content

Commit 914db8c

Browse files
committed
fixed npe
1 parent 1e85ca3 commit 914db8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ public Map<String, Object> postProcessOperations(Map<String, Object> objs) {
491491
@Override
492492
public String getSwaggerType(Property p) {
493493
String swaggerType = super.getSwaggerType(p);
494-
if (p instanceof RefProperty) {
494+
if (p instanceof RefProperty && this.swagger != null) {
495495
final Map<String, Model> allDefinitions = this.swagger.getDefinitions();
496496
final Model referencedModel = allDefinitions.get(swaggerType);
497497
if (referencedModel == null) {

0 commit comments

Comments
 (0)