Skip to content

Commit b22e0f9

Browse files
author
Matthias Kastner
committed
fix search in empty decl wave
when having a procedure with no entries and searching in it, this lead to the CodeBrowser crashing.
1 parent 662a43b commit b22e0f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

procedures/CodeBrowser.ipf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,11 @@ Function searchAndDelete(decls, lines, searchString)
947947

948948
Variable i, numEntries
949949

950-
// search and delete backwards for simplicity reasons
951950
numEntries = Dimsize(decls, 0)
951+
if(numEntries == 0)
952+
return 0
953+
endif
954+
952955
for(i = numEntries - 1; i > 0; i -= 1)
953956
if(strsearch(decls[i][1], searchString, 0, 2) == -1)
954957
DeletePoints/M=0 i, 1, decls, lines

0 commit comments

Comments
 (0)