It was just a missed line of code, like it almost always is.
Accessing a NULL in memory = bad