zclwrite: Don't crash if EachToken called on a nil TokenSeq.

This commit is contained in:
Martin Atkins 2017-06-07 07:39:01 -07:00
parent 69a87c73b4
commit ed2a739cdb

View File

@ -51,6 +51,9 @@ func (ts Tokens) EachToken(cb TokenCallback) {
}
func (ts *TokenSeq) EachToken(cb TokenCallback) {
if ts == nil {
return
}
for _, gen := range *ts {
gen.EachToken(cb)
}