Re-order null checks. Output array should never be null.