Potencial NullPointerException fixes (#11923)

* Update pom.xml

* Create build.yml

* Eliminación de posibles NullPointerException

* Delete build.yml

* Update pom.xml
This commit is contained in:
Ismael Barrera García 2022-03-21 16:32:17 +01:00 committed by GitHub
parent e159919ba5
commit ba76ec9551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1007,7 +1007,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig {
&& cgOperation.vendorExtensions.get(X_OPERATION_GROUPING) instanceof java.util.Map) {
Map.Entry<?, ?> operationGroupingEntry = ((Map<?, ?>) cgOperation.vendorExtensions
.get(X_OPERATION_GROUPING)).entrySet().stream().findFirst().get();
.get(X_OPERATION_GROUPING)).entrySet().stream().findFirst().orElse(null);
return Optional.of(new OperationGrouping(String.valueOf(operationGroupingEntry.getKey()),
Integer.parseInt(String.valueOf(operationGroupingEntry.getValue()))));

View File

@ -144,7 +144,7 @@ public class PythonClientCodegen extends PythonLegacyClientCodegen {
.reduce((a, b) -> {
throw new IllegalStateException("Multiple elements: " + a + ", " + b);
})
.get();
.orElse(null);
supportingFiles.remove(originalInitModel);
supportingFiles.add(new SupportingFile("__init__model.mustache", packagePath() + File.separatorChar + "model", "__init__.py"));
supportingFiles.add(new SupportingFile("__init__apis.mustache", packagePath() + File.separatorChar + "apis", "__init__.py"));