diff --git a/src/public/app/widgets/find_in_text.js b/src/public/app/widgets/find_in_text.js index 369eb736a..a3f142d4f 100644 --- a/src/public/app/widgets/find_in_text.js +++ b/src/public/app/widgets/find_in_text.js @@ -105,14 +105,14 @@ export default class FindInText { } async replace(replaceText) { - if (this.editingState.highlightedResult !== null) { + if (this.editingState !== undefined && this.editingState.highlightedResult !== null) { const textEditor = await this.getTextEditor(); textEditor.execute('replace', replaceText, this.editingState.highlightedResult); } } async replaceAll(replaceText) { - if (this.editingState.results.length > 0) { + if (this.editingState !== undefined && this.editingState.results.length > 0) { const textEditor = await this.getTextEditor(); textEditor.execute('replaceAll', replaceText, this.editingState.results); }