Correct nullability for FlutterStandardReader (flutter/engine#8537)

FlutterStandardReader's `readValueOfType:` method returns nil when
called with `FlutterStandardFieldNil`. By extension, `readValue` can
also return nil values.
This commit is contained in:
Chris Bracken 2019-04-11 09:59:08 -07:00 committed by GitHub
parent cc922189fe
commit d467c50378
2 changed files with 4 additions and 4 deletions

View File

@ -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
/**

View File

@ -408,11 +408,11 @@ using namespace flutter;
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: