Commit 6e1cc5e4 authored by alex yao's avatar alex yao

fix:【POE】-【应用创建】AI自动配置 随机自动和AI生成 都会报错java.lang.NullPointerException

parent c964b8c3
......@@ -20,6 +20,22 @@ public class Variable {
this.variableDefault = variableDefault;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Variable variable = (Variable) o;
if (!key.equals(variable.key)) return false;
return variableDefault.equals(variable.variableDefault);
}
@Override
public int hashCode() {
int result = key.hashCode();
result = 31 * result + variableDefault.hashCode();
return result;
}
@Override
public String toString() {
return "Variable{" +
......
......@@ -152,12 +152,9 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
// 如果存在agentId,则判断变量结构是否有变化,如果有变化,则删除redis中的数据
if (StringUtils.isNotBlank(entity.getAgentId())) {
BizAgentApplicationInfoEntity infoEntity = bizAgentApplicationInfoService.getByAgentId(entity.getAgentId());
if (infoEntity.getVariableStructure() != null || !infoEntity.getVariableStructure().equals(entity.getVariableStructure())) {
String contentKey = SetValueMemoryConstants.REDIS_PREFIX + dto.getBaseInfo().getAgentId() + ":" + BlContext.getCurrentUserNotException().getUserId().toString();
redisService.del(contentKey);
}
}
return AgentApplicationInfoConvert.entityToDto(StringUtils.isEmpty(entity.getAgentId()) ?
bizAgentApplicationInfoService.save(entity) : bizAgentApplicationInfoService.update(entity));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment