Skip to content

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

fix: nil instance (#10610)

p0ny5b0ff7c252d3
diff --git a/backend/api/v1/org_policy_service.go b/backend/api/v1/org_policy_service.go
index fce085e5ad..114a57035b 100644
--- a/backend/api/v1/org_policy_service.go
+++ b/backend/api/v1/org_policy_service.go
@@ -313,6 +313,9 @@ func (s *OrgPolicyService) getPolicyResourceTypeAndID(ctx context.Context, reque
if err != nil {
return api.PolicyResourceTypeUnknown, nil, status.Errorf(codes.Internal, err.Error())
}
+ if instance == nil {
+ return api.PolicyResourceTypeUnknown, nil, status.Errorf(codes.NotFound, "instance %q not found", instanceID)
+ }
database, err := s.findActiveDatabase(ctx, &store.FindDatabaseMessage{
InstanceID: &instanceID,
DatabaseName: &databaseName,