avoid bad dereference of first element in empty array