better null check to surpress sonarcloud warning (#9888)

This commit is contained in:
William Cheng 2021-07-04 15:16:19 +08:00 committed by GitHub
parent d2e79be728
commit a5c98dd416
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2834,7 +2834,7 @@ public class DefaultCodegen implements CodegenConfig {
"'{}' defines discriminator '{}', but the referenced AnyOf schema '{}' is missing {}", "'{}' defines discriminator '{}', but the referenced AnyOf schema '{}' is missing {}",
composedSchemaName, discPropName, modelName, discPropName); composedSchemaName, discPropName, modelName, discPropName);
} }
if (cp.dataType == null) { if (cp != null && cp.dataType == null) {
cp = thisCp; cp = thisCp;
continue; continue;
} }