Skip to content

Commit

Permalink
Correct nullability for FlutterStandardReader (flutter#8537)
Browse files Browse the repository at this point in the history
FlutterStandardReader's `readValueOfType:` method returns nil when
called with `FlutterStandardFieldNil`. By extension, `readValue` can
also return nil values.
  • Loading branch information
cbracken authored Apr 11, 2019
1 parent c00364a commit f53e477
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions shell/platform/darwin/ios/framework/Headers/FlutterCodecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ FLUTTER_EXPORT
- (UInt32)readSize;
- (void)readAlignment:(UInt8)alignment;
- (NSString*)readUTF8;
- (id)readValue;
- (id)readValueOfType:(UInt8)type;
- (nullable id)readValue;
- (nullable id)readValueOfType:(UInt8)type;
@end

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,11 @@ - (FlutterStandardTypedData*)readTypedDataOfType:(FlutterStandardDataType)type {
return [FlutterStandardTypedData typedDataWithData:data type:type];
}

- (id)readValue {
- (nullable id)readValue {
return [self readValueOfType:[self readByte]];
}

- (id)readValueOfType:(UInt8)type {
- (nullable id)readValueOfType:(UInt8)type {
FlutterStandardField field = (FlutterStandardField)type;
switch (field) {
case FlutterStandardFieldNil:
Expand Down

0 comments on commit f53e477

Please sign in to comment.