Skip to content

Commit

Permalink
fix NPE reported in swagger-api#6519 (swagger-api#6635)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 authored and fvarose committed Oct 12, 2017
1 parent e3c6f4d commit 8d2f02d
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2739,11 +2739,19 @@ public CodegenParameter fromParameter(Parameter param, Set<String> imports) {
}

public boolean isDataTypeBinary(String dataType) {
return dataType.toLowerCase().startsWith("byte");
if (dataType != null) {
return dataType.toLowerCase().startsWith("byte");
} else {
return false;
}
}

public boolean isDataTypeFile(String dataType) {
return dataType.toLowerCase().equals("file");
if (dataType != null) {
return dataType.toLowerCase().equals("file");
} else {
return false;
}
}

/**
Expand Down

0 comments on commit 8d2f02d

Please sign in to comment.