Is there an existing issue for this?
Steps to reproduce
- Using pigeon
10.0.1
- Run swift generator for schema:
@FlutterApi()
abstract class NativeAuthPlugin {
@async
NativeAuthSession fetchAuthSession();
}
class NativeAuthSession {
late bool isSignedIn;
String? userSub;
NativeUserPoolTokens? userPoolTokens;
String? identityId;
NativeAWSCredentials? awsCredentials;
}
class NativeUserPoolTokens {
late String accessToken;
late String refreshToken;
late String idToken;
}
class NativeAWSCredentials {
late String accessKeyId;
late String secretAccessKey;
String? sessionToken;
String? expirationIso8601Utc;
}
- Send
null for userPoolTokens (code from unit test)
lazy var codec = NativeAuthPluginCodec.shared
func send(
onChannel channel: String,
message: Data?,
binaryReply callback: FlutterBinaryReply? = nil
) {
let authSession = NativeAuthSession(
isSignedIn: isSignedIn,
userSub: nil,
userPoolTokens: nil,
identityId: nil,
awsCredentials: nil
)
let encodedAuthSession = codec.encode(authSession)
callback?(encodedAuthSession)
}
Expected results
Passing null for userPoolTokens should work. This code worked with pigeon v9 output.
Actual results
A crash is observed running in Xcode.
Code sample
Included above.
Screenshots or Video
Logs
Logs
Test Case '-[unit_tests.NativeAuthPluginTests testFetchAuthSessionSignedIn]' started.
Could not cast value of type 'NSNull' (0x107eaa978) to 'NSArray' (0x107eaaa20).
2023-06-21 08:02:22.225474-0700 Runner[54059:310281] Could not cast value of type 'NSNull' (0x107eaa978) to 'NSArray' (0x107eaaa20).
Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4 22F66 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1)
[✓] VS Code (version 1.79.2)
[✓] Connected device (2 available)
[✓] Network resources
• No issues found!
Is there an existing issue for this?
Steps to reproduce
10.0.1nullforuserPoolTokens(code from unit test)Expected results
Passing
nullforuserPoolTokensshould work. This code worked with pigeon v9 output.Actual results
A crash is observed running in Xcode.
Code sample
Included above.
Screenshots or Video
Logs
Logs
Flutter Doctor output
Doctor output