Check to prevent null pointer exceptions.

A null array is in some cases passed with empty tables,
which as expected result in void ones, but a NullPoin-
terException is thrown. We now avoid this.