Skip to content

Commit 3532ecf

Browse files
committed
chore: remove unnecessary null checks in template variable validation
- Simplified code by dropping redundant null checks Signed-off-by: csbiy <[email protected]>
1 parent c7f7b68 commit 3532ecf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-ai-template-st/src/main/java/org/springframework/ai/template/st/StTemplateRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private ST createST(String template) {
128128
*/
129129
private Set<String> validate(ST st, Map<String, Object> templateVariables) {
130130
Set<String> templateTokens = getInputVariables(st);
131-
Set<String> modelKeys = templateVariables != null ? templateVariables.keySet() : new HashSet<>();
131+
Set<String> modelKeys = templateVariables.keySet();
132132
Set<String> missingVariables = new HashSet<>(templateTokens);
133133
missingVariables.removeAll(modelKeys);
134134

0 commit comments

Comments
 (0)