mirror of https://github.com/laurent22/joplin.git
Desktop: Fixes #5417: Handle invalid search index in Goto Anything
parent
c529b972e3
commit
71c470f59d
|
@ -337,6 +337,10 @@ class Dialog extends React.PureComponent<Props, State> {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const notesById = notes.reduce((obj, { id, body, markup_language }) => ((obj[[id]] = { id, body, markup_language }), obj), {});
|
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++) {
|
for (let i = 0; i < results.length; i++) {
|
||||||
const row = results[i];
|
const row = results[i];
|
||||||
const path = Folder.folderPathString(this.props.folders, row.parent_id);
|
const path = Folder.folderPathString(this.props.folders, row.parent_id);
|
||||||
|
|
Loading…
Reference in New Issue