Skip to content

Commit cdb5fd3

Browse files
author
Matthias Kastner
committed
fallback to first item
on error, output first item instead of "_error_"
1 parent 9a200df commit cdb5fd3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

procedures/CodeBrowser_gui.ipf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ Function/S getCurrentItem([module, procedure, index])
274274

275275
rawList = GetUserData(panel, procCtrl, userDataRawList)
276276
if(V_Value < 0 || V_Value >= ItemsInList(rawList))
277+
if(ItemsInList(rawList) > 0)
278+
// fall back to first item
279+
return StringFromList(0, rawList)
280+
endif
277281
return "_error_"
278282
endif
279283

0 commit comments

Comments
 (0)