guard against next[id] as null
Merge pull request #5 from substack/master

guard against next[id] as null