Skip to content
Advertisement

Program won’t run after a while, and I get this

I have really messed with this one for a while now, and I can’t figure it out.

I’m in the process of making an breakout game, but I keep getting this error suddenly:

JavaScript

Here’s the code for: at com.spil.Start.sortTable(Start.java:388)

JavaScript

Can someone show me what I am doing wrong or missing? It worked well before, and suddenly it gives this.

Advertisement

Answer

In the following code, the line.split doesn’t seem to be returning you an array of size 2 (or more as per your requirement).

JavaScript

You can get rid of the issue by checking the size of the array before trying to access an element from it e.g.

JavaScript

However, I would recommend you to find why line.split is not returning you an array of size 2 (or more as per your requirement). You need to check the content of the file.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement