aboutsummaryrefslogtreecommitdiff
path: root/src/text/template/exec.go
diff options
context:
space:
mode:
authorNodir Turakulov <nodir@google.com>2015-09-05 23:16:49 -0700
committerRob Pike <r@golang.org>2015-09-09 23:25:44 +0000
commit6599450016244b9e3e074e87d7064219ee2e5cf8 (patch)
treeaa84a8f7790fe645868195cb1d259fd6a4ec6bbc /src/text/template/exec.go
parent00c638d243056b24f1deeb2d1d954e62baedd468 (diff)
downloadgo-6599450016244b9e3e074e87d7064219ee2e5cf8.tar.xz
text/template: perform value validity checks
Check reflect.Value.IsValid() before calling other reflect.Value methods that panic on zero values. Added tests for cases with untyped nils. They panicked without these fixes. Removed a TODO. Fixes #12356 Change-Id: I9b5cbed26db09a0a7c36d99a93f8b9729899d51e Reviewed-on: https://go-review.googlesource.com/14340 Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/text/template/exec.go')
-rw-r--r--src/text/template/exec.go2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/text/template/exec.go b/src/text/template/exec.go
index 6e46d054a8..625e9b54d6 100644
--- a/src/text/template/exec.go
+++ b/src/text/template/exec.go
@@ -135,8 +135,6 @@ func errRecover(errp *error) {
*errp = err.Err // Strip the wrapper.
case ExecError:
*errp = err // Keep the wrapper.
- case error: // TODO: This should never happen, but it does. Understand and/or fix.
- *errp = err
default:
panic(e)
}