CC: Tweaked

CC: Tweaked

42M Downloads

<stringVariable>:find() causing vm exception (java.lang.ArrayIndexOutOfBoundsException)

fatboychummy opened this issue ยท 1 comments

commented

Error:

vm error: java.lang.ArrayIndexOutOfBoundsException

Cause:

I am making a thing that reads through files to check if it's a FATFILE (aka a file that is made by me, and thus compatible with certain things). The program in question reads each line, and does a very simple operation on each line.

That operation would be:

currentLine:find("--[[FATFILE")

This seems to cause an array index out of bounds exception.

Information:

MC version:

1.12.2

CC:Tweaked version:

1.12.2-1.81.1

Forge:

14.23.5.2824

The program in question:

Lonky Link to the Program

The erroring line is on line 54.

Maybe helpful screenshots:

image

commented

Worth noting that you should probably be doing :find("--[[FATFILE", 1, true) instead.