Skip to content

Commit 99a88ce

Browse files
committed
revel#944 fix for non-struct embed causes panic
1 parent 42f4bd3 commit 99a88ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,12 @@ func findControllers(appControllerType reflect.Type) (indexes [][]int) {
329329
}
330330
queue = queue[1:]
331331

332+
// #944 if the type's Kind is not `Struct` move on,
333+
// otherwise `elem.NumField()` will panic
334+
if elemType.Kind() != reflect.Struct {
335+
continue
336+
}
337+
332338
// Look at all the struct fields.
333339
for i := 0; i < elem.NumField(); i++ {
334340
// If this is not an anonymous field, skip it.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy