This line is weird, probably should be `len = csr ? csr.length : 0`