Skip to content

Commit b117991

Browse files
committed
Fix GetNextIndex method to initialize pIndex to 0 and update index validation for array handling
1 parent ca7954c commit b117991

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/iop/cls/IOP/Message.cls

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ Method GetNextIndex(
3434
ByRef pStatus As %Status = {$$$OK}) As %String
3535
{
3636
Set f=$F(pPath,"()") If 'f Set pStatus=$$$ERROR($$$EnsErrGeneral,"Can't iterate on no-array type '"_pPath_"'") Quit ""
37-
if pIndex="" Set pIndex=1
37+
if pIndex="" Set pIndex=0
3838
Set tValue = ..GetValueAt($EXTRACT(pPath, 1, $LENGTH(pPath)-2))
39-
if pIndex>$LENGTH(tValue) Quit ""
39+
Set builtins = ##class(%SYS.Python).Builtins()
40+
if pIndex>=builtins.len(tValue) Quit ""
4041
Quit pIndex+1
4142
}
4243

0 commit comments

Comments
 (0)