You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2024/01/18 09:56:10 UTC

(camel) branch main updated: CAMEL-20342: camel-openapi-java - NPE in OpenApiHelper

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new eb770029ce4 CAMEL-20342: camel-openapi-java - NPE in OpenApiHelper
eb770029ce4 is described below

commit eb770029ce429424d40bdafecfed3494cfacc116
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Jan 18 10:55:49 2024 +0100

    CAMEL-20342: camel-openapi-java - NPE in OpenApiHelper
---
 .../src/main/java/org/apache/camel/openapi/OpenApiHelper.java         | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java
index aac2b146985..4f22bd28139 100644
--- a/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java
+++ b/components/camel-openapi-java/src/main/java/org/apache/camel/openapi/OpenApiHelper.java
@@ -56,7 +56,9 @@ public final class OpenApiHelper {
         if (openApi.getComponents() != null
                 && openApi.getComponents().getSchemas() != null) {
             for (Schema<?> schemaDefinition : openApi.getComponents().getSchemas().values()) {
-                schemaDefinition.getExtensions().clear();
+                if (schemaDefinition.getExtensions() != null) {
+                    schemaDefinition.getExtensions().clear();
+                }
             }
         }
         if (openApi.getPaths() != null) {