[issue-6860] fix NPE of Could not generate api (#6868)

This commit is contained in:
Jinkui Shi 2017-11-07 15:46:20 +08:00 committed by wing328
parent 39a9c5587f
commit 92a1c3a449

View File

@ -2886,7 +2886,7 @@ public class DefaultCodegen {
* @return true if the library/module/package of the corresponding type needs to be imported * @return true if the library/module/package of the corresponding type needs to be imported
*/ */
protected boolean needToImport(String type) { protected boolean needToImport(String type) {
return !defaultIncludes.contains(type) return StringUtils.isNotBlank(type) && !defaultIncludes.contains(type)
&& !languageSpecificPrimitives.contains(type); && !languageSpecificPrimitives.contains(type);
} }