Merge pull request #590 from hqhq/hq_fix_stacktrace_panic
Fix stacktrace panic
This commit is contained in:
commit
6dd5d073b3
|
@ -9,6 +9,9 @@ import (
|
||||||
// NewFrame returns a new stack frame for the provided information
|
// NewFrame returns a new stack frame for the provided information
|
||||||
func NewFrame(pc uintptr, file string, line int) Frame {
|
func NewFrame(pc uintptr, file string, line int) Frame {
|
||||||
fn := runtime.FuncForPC(pc)
|
fn := runtime.FuncForPC(pc)
|
||||||
|
if fn == nil {
|
||||||
|
return Frame{}
|
||||||
|
}
|
||||||
pack, name := parseFunctionName(fn.Name())
|
pack, name := parseFunctionName(fn.Name())
|
||||||
return Frame{
|
return Frame{
|
||||||
Line: line,
|
Line: line,
|
||||||
|
|
Loading…
Reference in New Issue