Resolve CID 1037098

The CID is about checking the *tok* pointer inside the loop but then blindly dereferencing it in the loop statement when calling *->next()*.