FB-1505 - check if view 'standard' exists

This commit is contained in:
Hoang Pham 2022-06-30 16:23:27 -05:00 committed by Matthew Jaffee
parent 51ca8a131b
commit c0d630bee2

View file

@ -898,8 +898,8 @@ func (s *Server) ViewsRemoval(ctx context.Context) {
}
}
}
if field.Options().NoStandardView {
// delete view "standard" if NoStandardView is true
if field.Options().NoStandardView && field.view(viewStandard) != nil {
// delete view "standard" if NoStandardView is true and view "standard" exists
for _, shard := range field.AvailableShards(true).Slice() {
err := s.holder.txf.DeleteFragmentFromStore(index.Name(), field.Name(), viewStandard, shard, nil)
if err != nil {