return nil interface{} if index doesn't exist
This fixes the bug  when the backup manager gets a non nil pointer to an index implementing the snapshotter interface even when it doesn' exit
@@ -26,5 +26,8 @@ type snapshotterProvider struct {
}
func (sp *snapshotterProvider) Snapshotter(className string) backup.Snapshotter {
- return sp.db.GetIndex(schema.ClassName(className))
+ if idx := sp.db.GetIndex(schema.ClassName(className)); idx != nil {
+ return idx
+ }
+ return nil
}
