Commit 1b101181 authored by Ryan Lamore's avatar Ryan Lamore Committed by Han-Wen Nienhuys

fixed debug mode panics w/ invalid opcode

parent fa130474
...@@ -79,7 +79,7 @@ func (r *request) clear() { ...@@ -79,7 +79,7 @@ func (r *request) clear() {
func (r *request) InputDebug() string { func (r *request) InputDebug() string {
val := "" val := ""
if r.handler.DecodeIn != nil { if r.handler != nil && r.handler.DecodeIn != nil {
val = fmt.Sprintf("%v ", Print(r.handler.DecodeIn(r.inData))) val = fmt.Sprintf("%v ", Print(r.handler.DecodeIn(r.inData)))
} }
...@@ -99,7 +99,7 @@ func (r *request) InputDebug() string { ...@@ -99,7 +99,7 @@ func (r *request) InputDebug() string {
func (r *request) OutputDebug() string { func (r *request) OutputDebug() string {
var dataStr string var dataStr string
if r.handler.DecodeOut != nil && r.handler.OutputSize > 0 { if r.handler != nil && r.handler.DecodeOut != nil && r.handler.OutputSize > 0 {
dataStr = Print(r.handler.DecodeOut(r.outData())) dataStr = Print(r.handler.DecodeOut(r.outData()))
} }
...@@ -110,7 +110,7 @@ func (r *request) OutputDebug() string { ...@@ -110,7 +110,7 @@ func (r *request) OutputDebug() string {
flatStr := "" flatStr := ""
if r.flatDataSize() > 0 { if r.flatDataSize() > 0 {
if r.handler.FileNameOut { if r.handler != nil && r.handler.FileNameOut {
s := strings.TrimRight(string(r.flatData), "\x00") s := strings.TrimRight(string(r.flatData), "\x00")
flatStr = fmt.Sprintf(" %q", s) flatStr = fmt.Sprintf(" %q", s)
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment