From 065a59c3b7796c7cc7e15b1695aa874826b7edba Mon Sep 17 00:00:00 2001 From: Paul Gooderham Date: Wed, 9 Oct 2024 14:35:37 -0400 Subject: [PATCH] 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/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java b/src/main/java/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java index 9dd4d1500..c2df79979 100644 --- a/src/main/java/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java +++ b/src/main/java/io/openliberty/tools/intellij/lsp4mp4ij/psi/internal/openapi/java/MicroProfileGenerateOpenAPIOperation.java @@ -69,6 +69,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);