Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html/template: Clone an empty template leads to runtime panic #10879

Closed
paradoxe opened this issue May 16, 2015 · 2 comments
Closed

html/template: Clone an empty template leads to runtime panic #10879

paradoxe opened this issue May 16, 2015 · 2 comments
Milestone

Comments

@paradoxe
Copy link

Hi,
When executing:

t:= template.New("base")
c, err := t.Clone()

I get:

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4b78dc]
goroutine 1 [running]:
text/template.(_Template).Clone(0xc20806a040, 0x5516a0, 0x0, 0x0)
/usr/local/go/src/text/template/template.go:78 +0x1cc
html/template.(_Template).Clone(0xc20803a5a0, 0x0, 0x0, 0x0)
/usr/local/go/src/html/template/template.go:193 +0x20d

I admit that it is an extreme use-case.

go version go1.4.2 linux/amd64

Many thanks

@syst3mw0rm
Copy link
Contributor

@gopherbot
Copy link

CL https://golang.org/cl/10240 mentions this issue.

@adg adg changed the title html/template Clone an empty template leads to runtime panic html/template: Clone an empty template leads to runtime panic May 19, 2015
@robpike robpike closed this as completed in 8801bdf Jun 1, 2015
@mikioh mikioh added this to the Go1.5 milestone Jun 2, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants