Potentially out of bounds arguments should not just be directly accessed, instead use a ternary operator to check length.