Cannot read property 'indexOf' of null

nil