If a NULL pointer is passed for errcodes, don't assign