Skip to content

Commit fca364f

Browse files
committed
Minor bug-fix
1 parent 41c65db commit fca364f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

client/utils/codemirror-search.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ function persistentDialog(cm, text, deflt, onEnter, replaceOpened, onKeyDown) {
224224
if (state.replaceStarted) {
225225
var cursor = getSearchCursor(cm, query, cm.getCursor("from"));
226226
var match = cursor.findNext();
227-
cm.setSelection(cursor.from(), cursor.to());
228-
doReplace(match, cursor, query, withText);
227+
if (match) {
228+
cm.setSelection(cursor.from(), cursor.to());
229+
doReplace(match, cursor, query, withText);
230+
}
229231
} else {
230232
startSearch(cm, state, searchField.value);
231233
state.replaceStarted = true;

0 commit comments

Comments
 (0)