diff --git a/lib/model/model.go b/lib/model/model.go index a270cc7f2..50c9d466f 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -893,6 +893,10 @@ func (m *Model) GetIgnores(folder string) ([]string, []string, error) { return lines, nil, fmt.Errorf("Folder %s does not exist", folder) } + if !cfg.HasMarker() { + return lines, nil, fmt.Errorf("Folder %s stopped", folder) + } + fd, err := os.Open(filepath.Join(cfg.Path(), ".stignore")) if err != nil { if os.IsNotExist(err) { diff --git a/lib/model/model_test.go b/lib/model/model_test.go index 3b92fe6be..12b1b31fb 100644 --- a/lib/model/model_test.go +++ b/lib/model/model_test.go @@ -514,13 +514,11 @@ func TestIgnores(t *testing.T) { t.Error("No error") } + // Invalid path, marker should be missing, hence returns an error. m.AddFolder(config.FolderConfiguration{ID: "fresh", RawPath: "XXX"}) ignores, _, err = m.GetIgnores("fresh") - if err != nil { - t.Error(err) - } - if len(ignores) > 0 { - t.Errorf("Expected no ignores, got: %v", ignores) + if err == nil { + t.Error("No error") } }