Browse Source

Fixed array bounds issue. Resolves #593.

Brucey 2 years ago
parent
commit
d3b5ab2890
1 changed files with 4 additions and 2 deletions
  1. 4 2
      toker.bmx

+ 4 - 2
toker.bmx

@@ -441,8 +441,10 @@ Type TToker
 	Method Join:String(startLine:Int, endLine:Int, s:String)
 		Local sb:TStringBuffer = New TStringBuffer
 		For Local i:Int = startLine - 1 To endLine
-			sb.Append(_lines[i])
-			sb.Append(s)
+			If i < _lines.Length Then
+				sb.Append(_lines[i])
+				sb.Append(s)
+			End If
 		Next
 		Return sb.ToString()
 	End Method