Joker / jade

Jade.go - pug template engine for Go (golang)
BSD 3-Clause "New" or "Revised" License
354 stars 37 forks source link

Don't panic on error. #4

Closed omeid closed 8 years ago

omeid commented 8 years ago

If there is an early parse error before a Root node is created. The Parse function panics.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x6caa24]

goroutine 71 [running]:
github.com/Joker/jade.(*tree).String(0x0, 0x0, 0x0)
    /home/GO/go/src/github.com/Joker/jade/template.go:41 +0x24
github.com/Joker/jade.Parse(0xc820214250, 0xb, 0xc820618000, 0x54a, 0x0, 0x0, 0x0, 0x0)
    /home/GO/go/src/github.com/Joker/jade/template.go:37 +0x196
......