diff --git a/openframe-client-core/src/main/java/com/openframe/client/service/UserInstalledAgentService.java b/openframe-client-core/src/main/java/com/openframe/client/service/UserInstalledAgentService.java index c63817e45..243100bf9 100644 --- a/openframe-client-core/src/main/java/com/openframe/client/service/UserInstalledAgentService.java +++ b/openframe-client-core/src/main/java/com/openframe/client/service/UserInstalledAgentService.java @@ -11,6 +11,8 @@ import java.time.Instant; +import static org.springframework.util.StringUtils.hasText; + @Service @RequiredArgsConstructor @Slf4j @@ -72,13 +74,13 @@ private void validateUserExists(String userId) { } private void validateUserId(String userId) { - if (userId == null || userId.trim().isEmpty()) { + if (!hasText(userId)) { throw new IllegalArgumentException("User ID cannot be empty"); } } private void validateAgentType(String agentType) { - if (agentType == null || agentType.trim().isEmpty()) { + if (!hasText(agentType)) { throw new IllegalArgumentException("Agent type cannot be empty"); } }