Resolve CID 1037101. break after loop if tok is null because tok is dereferenced below. Ticket: #6055