I'm trying to write a program that prints out domino objects from an array of them into a grid, however whenever I run it I get an index out of bounds exception. I can make a singular line that moves along and draws each domino in the array which works fine, but a grid causes the following: 

```
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:653)
at java.util.ArrayList.get(ArrayList.java:429)
at DominoGame.drawTable(DominoGame.java:182)
at DominoGame.redraw(DominoGame.java:258)
at DominoGame.restart(DominoGame.java:119)
at DominoGame.<init>(DominoGame.java:91)
at DominoGame.main(DominoGame.java:262)

```

Here is my code:

```
    public void drawTable(){
        int i = 0;
        if(this.table.isEmpty()){
        }
        else{
            for(int col = 0;col<this.table.size();col++){
                for(int row = 0;row<this.table.size();row++){
                    this.table.get(i).draw(TABLE_LEFT+DOMINO_SPACING*row, TABLE_TOP+DOMINO_HEIGHT*col);
                    if(this.table.get(i+1) != null){
                        i++;
                    }
                }
            }
        }

    }

```

Many thanks for any help

EDIT: People have pointed out I had incorrect incrementation in my inner loop. I have fixed this, but I am still getting the error. Thanks