This bug has always existed but wasn't exposed until I recently started to remove side effects from its callers.
One of the side effects which I removed removed ensured that the argument never had zero references.
I still think that removing side effects is benefial to the code base, even if it removes some hidden assumptions.