diff --git a/encode_vm.go b/encode_vm.go index ecf6043..d38ceb6 100644 --- a/encode_vm.go +++ b/encode_vm.go @@ -1253,6 +1253,13 @@ func (e *Encoder) run(code *opcode) error { e.encodeIndent(code.indent) e.encodeNull() code = field.end.next + } else if field.next == field.end { + // not exists fields + e.encodeIndent(code.indent) + e.encodeBytes([]byte{'{', '}'}) + code = field.next + code.ptr = ptr + field.nextField.ptr = ptr } else { e.encodeIndent(code.indent) e.encodeBytes([]byte{'{', '\n'})