Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(setting_service): npe (#13476)

Azusain7f92ba48579f
diff --git a/backend/api/v1/setting_service.go b/backend/api/v1/setting_service.go
index a1d8a30027..4d95ae4a24 100644
--- a/backend/api/v1/setting_service.go
+++ b/backend/api/v1/setting_service.go
@@ -166,7 +166,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.NotFound, "setting %s not found", settingName)
}
// audit log.
- if setServiceData, ok := common.GetSetServiceDataFromContext(ctx); ok {
+ if setServiceData, ok := common.GetSetServiceDataFromContext(ctx); ok && existedSetting != nil {
v1pbSetting, err := s.convertToSettingMessage(ctx, existedSetting)
if err != nil {
slog.Warn("audit: failed to convert to v1.Setting", log.BBError(err))