mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-09-24 16:29:01 +08:00
fix: Ensure safe access to tenant agent configuration in update handler
This commit is contained in:
@@ -355,7 +355,10 @@ func (h *TenantHandler) updateTenantAgentConfigInternal(c *gin.Context) {
|
||||
// Get existing tenant
|
||||
tenant := ctx.Value(types.TenantInfoContextKey).(*types.Tenant)
|
||||
// Update agent configuration
|
||||
useCustomPrompt := tenant.AgentConfig.UseCustomSystemPrompt
|
||||
useCustomPrompt := false
|
||||
if tenant.AgentConfig != nil {
|
||||
useCustomPrompt = tenant.AgentConfig.UseCustomSystemPrompt
|
||||
}
|
||||
if req.UseCustomPrompt != nil {
|
||||
useCustomPrompt = *req.UseCustomPrompt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user