mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
cc922189fe
commit
d467c50378
@ -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
|
||||
|
||||
/**
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user