From 7dcfd729d93b4fb8630c99b3bbf26572a07a9f19 Mon Sep 17 00:00:00 2001 From: Paul Gooderham Date: Wed, 9 Oct 2024 14:38:37 -0400 Subject: [PATCH] fix: Check for null or empty class name in generate OpenAPI annotations Signed-off-by: Paul Gooderham --- .../openapi/java/MicroProfileGenerateOpenAPIOperation.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java index c0745ef5f..133ab762c 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java @@ -66,6 +66,9 @@ public List getCodeActions(JavaCodeActionContext context, if (type instanceof PsiClass) { PsiClass typeDeclaration = (PsiClass) type; String typeName = typeDeclaration.getQualifiedName(); + if (typeName == null || typeName.isBlank()) { + continue; + } Map extendedData = new HashMap<>(); extendedData.put(TYPE_NAME_KEY, typeName);