1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00

Desktop: Fixes #5417: Handle invalid search index in Goto Anything

This commit is contained in:
Laurent Cozic 2021-09-04 14:26:29 +01:00
parent c529b972e3
commit 71c470f59d

View File

@ -337,6 +337,10 @@ class Dialog extends React.PureComponent<Props, State> {
// @ts-ignore
const notesById = notes.reduce((obj, { id, body, markup_language }) => ((obj[[id]] = { id, body, markup_language }), obj), {});
// Filter out search results that are associated with non-existing notes.
// https://github.com/laurent22/joplin/issues/5417
results = results.filter(r => !!notesById[r.id]);
for (let i = 0; i < results.length; i++) {
const row = results[i];
const path = Folder.folderPathString(this.props.folders, row.parent_id);