diff --git a/core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/aiservice/QuarkusAiServiceContext.java b/core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/aiservice/QuarkusAiServiceContext.java index ac97e1fdb..a016bb68a 100644 --- a/core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/aiservice/QuarkusAiServiceContext.java +++ b/core/runtime/src/main/java/io/quarkiverse/langchain4j/runtime/aiservice/QuarkusAiServiceContext.java @@ -44,6 +44,9 @@ public void accept(Object memoryId, ChatMemory chatMemory) { * via {@link io.quarkiverse.langchain4j.ChatMemoryRemover} */ public void removeChatMemoryIds(Object... ids) { + if (chatMemories == null) { + return; + } for (Object id : ids) { ChatMemory chatMemory = chatMemories.remove(id); if (chatMemory != null) {