fix: type-switch capture, nil guard, LastInsertId error check

Three defensive fixes: 1) whatsapp_native - use type-switch capture instead of redundant unchecked assertion 2) config - add nil receiver guard to FilterSensitiveData 3) seahorse/store - check LastInsertId error in 3 locations
This commit is contained in:
程智超0668000959
2026-06-06 15:35:26 +08:00
parent 89ee8f1b39
commit 4752a67a7c
3 changed files with 17 additions and 5 deletions
+3
View File
@@ -194,6 +194,9 @@ type ExposePath struct {
// Uses strings.Replacer for O(n+m) performance (computed once per SecurityConfig).
// Short content (below FilterMinLength) is returned unchanged for performance.
func (c *Config) FilterSensitiveData(content string) string {
if c == nil {
return content
}
// Check if filtering is enabled (default: true)
if !c.Tools.IsFilterSensitiveDataEnabled() {
return content