Check if there are items in array before using it.