fix(scanner): handle nil mainCtx in Watcher to prevent panic
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
@@ -54,6 +54,15 @@ var _ = Describe("Watcher", func() {
|
||||
}
|
||||
})
|
||||
|
||||
Describe("Watch before Run", func() {
|
||||
It("returns nil and does not panic when mainCtx is nil", func() {
|
||||
w.mainCtx = nil
|
||||
err := w.Watch(ctx, lib)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(w.libraryWatchers).To(BeEmpty())
|
||||
})
|
||||
})
|
||||
|
||||
Describe("Target Collection and Deduplication", func() {
|
||||
BeforeEach(func() {
|
||||
// Start watcher in background
|
||||
|
||||
Reference in New Issue
Block a user