Skip to content

Commit

Permalink
fix optionalOf serialize bug primes-network#31
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangxn committed Jul 6, 2020
1 parent 48790fd commit fbdedf1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/src/serialize.dart
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,8 @@ void serializeStruct(Type self, SerialBuffer buffer, Object data,
} else {
if (allowExtensions && field.type.extensionOf != null) {
state.skippedBinaryExtension = true;
} else if(field.type.optionalOf != null ) {
field.type.serialize(field.type, buffer, dy[field.name],state: state);
} else {
throw 'missing ' +
self.name +
Expand Down

0 comments on commit fbdedf1

Please sign in to comment.