From 66e706beb7b8e647fc42a9866f9887caee9fb886 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Sun, 24 Jan 2021 14:57:57 +0900 Subject: [PATCH] Fix --- encode_vm_escaped.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/encode_vm_escaped.go b/encode_vm_escaped.go index 3b3a7d0..93f58c6 100644 --- a/encode_vm_escaped.go +++ b/encode_vm_escaped.go @@ -170,6 +170,12 @@ func (e *Encoder) runEscaped(ctx *encodeRuntimeContext, b []byte, codeSet *opcod } } iface := (*interfaceHeader)(e.ptrToUnsafePtr(ptr)) + if iface == nil { + b = encodeNull(b) + b = encodeComma(b) + code = code.next + break + } ctx.keepRefs = append(ctx.keepRefs, unsafe.Pointer(iface)) if iface.ptr == nil { b = encodeNull(b)