Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
b198b994
Commit
b198b994
authored
Sep 14, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not crash on nil data value
R=r DELTA=3 (3 added, 0 deleted, 0 changed) OCL=34606 CL=34609
parent
c5a441ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
template.go
src/pkg/template/template.go
+3
-0
No files found.
src/pkg/template/template.go
View file @
b198b994
...
@@ -575,6 +575,9 @@ func (st *state) findVar(s string) reflect.Value {
...
@@ -575,6 +575,9 @@ func (st *state) findVar(s string) reflect.Value {
for
i
:=
0
;
i
<
len
(
elems
);
i
++
{
for
i
:=
0
;
i
<
len
(
elems
);
i
++
{
// Look up field; data must be a struct.
// Look up field; data must be a struct.
data
=
reflect
.
Indirect
(
data
);
data
=
reflect
.
Indirect
(
data
);
if
data
==
nil
{
return
nil
}
typ
,
ok
:=
data
.
Type
()
.
(
*
reflect
.
StructType
);
typ
,
ok
:=
data
.
Type
()
.
(
*
reflect
.
StructType
);
if
!
ok
{
if
!
ok
{
return
nil
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment