{"action":"created","issue":{"url":"https://api.github.com/repos/go-macaron/macaron/issues/86","repository_url":"https://api.github.com/repos/go-macaron/macaron","labels_url":"https://api.github.com/repos/go-macaron/macaron/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/go-macaron/macaron/issues/86/comments","events_url":"https://api.github.com/repos/go-macaron/macaron/issues/86/events","html_url":"https://github.com/go-macaron/macaron/issues/86","id":142221242,"number":86,"title":"PANIC: reflect: call of reflect.Value.Interface on zero Value","user":{"login":"emersion","id":506932,"avatar_url":"https://avatars.githubusercontent.com/u/506932?v=3","gravatar_id":"","url":"https://api.github.com/users/emersion","html_url":"https://github.com/emersion","followers_url":"https://api.github.com/users/emersion/followers","following_url":"https://api.github.com/users/emersion/following{/other_user}","gists_url":"https://api.github.com/users/emersion/gists{/gist_id}","starred_url":"https://api.github.com/users/emersion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emersion/subscriptions","organizations_url":"https://api.github.com/users/emersion/orgs","repos_url":"https://api.github.com/users/emersion/repos","events_url":"https://api.github.com/users/emersion/events{/privacy}","received_events_url":"https://api.github.com/users/emersion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-20T23:37:58Z","updated_at":"2016-03-21T15:33:36Z","closed_at":null,"body":"```\r\n[Macaron] PANIC: reflect: call of reflect.Value.Interface on zero Value\r\n/usr/local/go/src/runtime/panic.go:426 (0x8070a0d)\r\n\tgopanic: reflectcall(nil, unsafe.Pointer(d.fn), deferArgs(d), uint32(d.siz), uint32(d.siz))\r\n/usr/local/go/src/reflect/value.go:913 (0x81a05fa)\r\n\tvalueInterface: panic(&ValueError{\"reflect.Value.Interface\", 0})\r\n/usr/local/go/src/reflect/value.go:908 (0x81a0572)\r\n\tValue.Interface: return valueInterface(v, true)\r\n/home/simon/go/src/github.com/go-macaron/binding/binding.go:333 (0x825ec6b)\r\n\tvalidateField: sliceValue := sliceVal.Interface()\r\n/home/simon/go/src/github.com/go-macaron/binding/binding.go:320 (0x825e9fe)\r\n\tvalidateStruct: errors = validateField(errors, zero, field, fieldVal, fieldValue)\r\n/home/simon/go/src/github.com/go-macaron/binding/binding.go:318 (0x825e95a)\r\n\tvalidateStruct: errors = validateStruct(errors, fieldValue)\r\n/home/simon/go/src/github.com/go-macaron/binding/binding.go:236 (0x8264d23)\r\n\tValidate.func1: errors = validateStruct(errors, obj)\r\n/usr/local/go/src/runtime/asm_386.s:488 (0x80973da)\r\n\tcall16: CALLFN(·call16, 16)\r\n/usr/local/go/src/reflect/value.go:435 (0x819ecdb)\r\n\tValue.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))\r\n/usr/local/go/src/reflect/value.go:303 (0x819dcfc)\r\n\tValue.Call: return v.call(\"Call\", in)\r\n/home/simon/go/src/github.com/go-macaron/inject/inject.go:117 (0x81b7fd4)\r\n\t(*injector).Invoke: return reflect.ValueOf(f).Call(in), nil\r\n/home/simon/go/src/github.com/go-macaron/binding/binding.go:633 (0x8263e61)\r\n\tvalidateAndMap: ctx.Invoke(Validate(obj.Interface()))\r\n/home/simon/go/src/github.com/go-macaron/binding/binding.go:210 (0x82649ed)\r\n\tJson.func1: validateAndMap(jsonStruct, ctx, errors, ifacePtr...)\r\n/usr/local/go/src/runtime/asm_386.s:488 (0x80973da)\r\n\tcall16: CALLFN(·call16, 16)\r\n/usr/local/go/src/reflect/value.go:435 (0x819ecdb)\r\n\tValue.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))\r\n/usr/local/go/src/reflect/value.go:303 (0x819dcfc)\r\n\tValue.Call: return v.call(\"Call\", in)\r\n/home/simon/go/src/github.com/go-macaron/inject/inject.go:117 (0x81b7fd4)\r\n\t(*injector).Invoke: return reflect.ValueOf(f).Call(in), nil\r\n/home/simon/go/src/gopkg.in/macaron.v1/context.go:113 (0x809bd54)\r\n\t(*Context).run: vals, err := c.Invoke(c.handler())\r\n/home/simon/go/src/gopkg.in/macaron.v1/context.go:104 (0x809bc68)\r\n\t(*Context).Next: c.run()\r\n/home/simon/go/src/gopkg.in/macaron.v1/recovery.go:161 (0x80ada5b)\r\n\tRecovery.func1: c.Next()\r\n/usr/local/go/src/runtime/asm_386.s:488 (0x80973da)\r\n\tcall16: CALLFN(·call16, 16)\r\n/usr/local/go/src/reflect/value.go:435 (0x819ecdb)\r\n\tValue.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))\r\n/usr/local/go/src/reflect/value.go:303 (0x819dcfc)\r\n\tValue.Call: return v.call(\"Call\", in)\r\n/home/simon/go/src/github.com/go-macaron/inject/inject.go:117 (0x81b7fd4)\r\n\t(*injector).Invoke: return reflect.ValueOf(f).Call(in), nil\r\n/home/simon/go/src/gopkg.in/macaron.v1/context.go:113 (0x809bd54)\r\n\t(*Context).run: vals, err := c.Invoke(c.handler())\r\n/home/simon/go/src/gopkg.in/macaron.v1/context.go:104 (0x809bc68)\r\n\t(*Context).Next: c.run()\r\n/home/simon/go/src/gopkg.in/macaron.v1/logger.go:40 (0x80aca1e)\r\n\tLogger.func1: ctx.Next()\r\n/usr/local/go/src/runtime/asm_386.s:488 (0x80973da)\r\n\tcall16: CALLFN(·call16, 16)\r\n/usr/local/go/src/reflect/value.go:435 (0x819ecdb)\r\n\tValue.call: call(frametype, fn, args, uint32(frametype.size), uint32(retOffset))\r\n/usr/local/go/src/reflect/value.go:303 (0x819dcfc)\r\n\tValue.Call: return v.call(\"Call\", in)\r\n/home/simon/go/src/github.com/go-macaron/inject/inject.go:117 (0x81b7fd4)\r\n\t(*injector).Invoke: return reflect.ValueOf(f).Call(in), nil\r\n/home/simon/go/src/gopkg.in/macaron.v1/context.go:113 (0x809bd54)\r\n\t(*Context).run: vals, err := c.Invoke(c.handler())\r\n/home/simon/go/src/gopkg.in/macaron.v1/router.go:184 (0x80aef02)\r\n\t(*Router).Handle.func1: c.run()\r\n/home/simon/go/src/gopkg.in/macaron.v1/router.go:286 (0x80a75bd)\r\n\t(*Router).ServeHTTP: h(rw, req, p)\r\n/home/simon/go/src/gopkg.in/macaron.v1/macaron.go:177 (0x80a041f)\r\n\t(*Macaron).ServeHTTP: m.Router.ServeHTTP(rw, req)\r\n/usr/local/go/src/net/http/server.go:2081 (0x816a256)\r\n\tserverHandler.ServeHTTP: handler.ServeHTTP(rw, req)\r\n/usr/local/go/src/net/http/server.go:1472 (0x81676a8)\r\n\t(*conn).serve: serverHandler{c.server}.ServeHTTP(w, w.req)\r\n/usr/local/go/src/runtime/asm_386.s:1585 (0x8099211)\r\n\tgoexit: BYTE\t$0x90\t// NOP\r\n```"},"comment":{"url":"https://api.github.com/repos/go-macaron/macaron/issues/comments/199342587","html_url":"https://github.com/go-macaron/macaron/issues/86#issuecomment-199342587","issue_url":"https://api.github.com/repos/go-macaron/macaron/issues/86","id":199342587,"user":{"login":"emersion","id":506932,"avatar_url":"https://avatars.githubusercontent.com/u/506932?v=3","gravatar_id":"","url":"https://api.github.com/users/emersion","html_url":"https://github.com/emersion","followers_url":"https://api.github.com/users/emersion/followers","following_url":"https://api.github.com/users/emersion/following{/other_user}","gists_url":"https://api.github.com/users/emersion/gists{/gist_id}","starred_url":"https://api.github.com/users/emersion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emersion/subscriptions","organizations_url":"https://api.github.com/users/emersion/orgs","repos_url":"https://api.github.com/users/emersion/repos","events_url":"https://api.github.com/users/emersion/events{/privacy}","received_events_url":"https://api.github.com/users/emersion/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T15:33:36Z","updated_at":"2016-03-21T15:33:36Z","body":"Yeah, that's what's causing the panic.\r\n\r\nA `null` value in an array is not parsed as `nil`, a panic is triggered instead."}}