Return from forEach immediately if array is null/undefined