Skip to content

Commit

Permalink
Fix GetNextIndex method to initialize pIndex to 0 and update index va…
Browse files Browse the repository at this point in the history
…lidation for array handling
  • Loading branch information
grongierisc committed Jan 9, 2025
1 parent ca7954c commit b117991
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/iop/cls/IOP/Message.cls
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ Method GetNextIndex(
ByRef pStatus As %Status = {$$$OK}) As %String
{
Set f=$F(pPath,"()") If 'f Set pStatus=$$$ERROR($$$EnsErrGeneral,"Can't iterate on no-array type '"_pPath_"'") Quit ""
if pIndex="" Set pIndex=1
if pIndex="" Set pIndex=0
Set tValue = ..GetValueAt($EXTRACT(pPath, 1, $LENGTH(pPath)-2))
if pIndex>$LENGTH(tValue) Quit ""
Set builtins = ##class(%SYS.Python).Builtins()
if pIndex>=builtins.len(tValue) Quit ""
Quit pIndex+1
}

Expand Down

0 comments on commit b117991

Please sign in to comment.