Add exception for empty location array