Skip to content

Commit 23d3c03

Browse files
committed
Fix inverted condition
linkMatchesPath validates that `err != nil` and then uses the non-error value. Invert this condition; only use the value if there **was not** an error.
1 parent 061d038 commit 23d3c03

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/adapter/sqlite/note_index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func (ni *NoteIndex) linkMatchesPath(link core.ResolvedLink, path string) (bool,
193193
}
194194

195195
baseDir := filepath.Join(ni.notebookPath, filepath.Dir(link.SourcePath))
196-
if relHref, err := ni.relNotebookPath(baseDir, href); err != nil {
196+
if relHref, err := ni.relNotebookPath(baseDir, href); err == nil {
197197
if matches(relHref, false) {
198198
return true, nil
199199
}

0 commit comments

Comments
 (0)