Skip to content

Commit 99382a7

Browse files
author
Lewis Mohr
committed
add default case for missing field in generated code
1 parent 0a69753 commit 99382a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/MsgPack/Serialization/AbstractSerializers/SerializerBuilder`3.Object.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,10 +436,16 @@ private IEnumerable<TConstruct> EmitObjectUnpackFromMapCore( TContext context, T
436436
unpackedKey =>
437437
this.EmitStoreVariableStatement( context, key, unpackedKey )
438438
);
439+
439440
var assigns =
440441
this.EmitStringSwitchStatement(
441442
context,
442443
key,
444+
this.EmitInvokeVoidMethod(
445+
context,
446+
context.Unpacker,
447+
typeof( Unpacker ).GetMethod( "Skip" )
448+
),
443449
entries.Where( e => e.Member != null ).ToDictionary(
444450
entry => entry.Contract.Name,
445451
entry =>

0 commit comments

Comments
 (0)