fixed a crash in my code

code wasn't detected before, it was a specific test case that I hadn't
hit, but ran a big trace file and hit it.