mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
### What problem does this PR solve? Fixes four Go paths that dereference a pointer with no prior nil check, each causing a **runtime panic**. Closes #15814. | # | File | Bug | Fix | |---|------|-----|-----| | 1 | `internal/entity/models/deepseek.go` | streaming path runs `switch *chatModelConfig.Effort` inside `if *Thinking`; panics when `Thinking=true` and `Effort==nil` | nil-check with default `"high"`, matching the non-streaming path in the same file | | 2 | `internal/entity/models/volcengine.go` | identical oversight: `switch *modelConfig.Effort` with no guard | nil-check with default `"medium"`, matching its non-streaming path | | 3 | `internal/handler/auth.go` | `AuthMiddleware` does `if *user.IsSuperuser`; panics on every authenticated request when the DB column is `NULL` | guard with `user.IsSuperuser != nil &&`, matching every other call site (`admin/handler.go`, `admin/service.go`, `user.go`) | | 4 | `internal/service/heartbeat_sender.go` | `responseBody["code"].(float64)` panics on any non-200 response lacking a numeric `code`; the upstream `recover()` calls `Fatal()` → `os.Exit(1)`, taking down the whole server | comma-ok assertion (`code, ok := ...`); return an error instead of panicking | - [x] Bug Fix (non-breaking change which fixes an issue)