File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
packages/_flutterfire_internals/lib/src Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -38,21 +38,27 @@ FirebaseException platformExceptionToFirebaseException(
3838 PlatformException platformException, {
3939 required String plugin,
4040}) {
41- Map <String , Object >? details = platformException.details != null
42- ? Map <String , Object >.from (platformException.details)
43- : null ;
41+ Map <String , Object >? details;
42+
43+ final rawDetails = platformException.details;
44+
45+ if (rawDetails is Map ) {
46+ details = Map <String , Object >.from (rawDetails);
47+ }
4448
4549 String ? code;
4650 String message = platformException.message ?? '' ;
4751
4852 if (details != null ) {
49- code = (details['code' ] as String ? ) ?? code;
50- message = (details['message' ] as String ? ) ?? message;
53+ code = details['code' ] as String ? ;
54+ message = details['message' ] as String ? ?? message;
55+ } else if (rawDetails != null ) {
56+ message = rawDetails.toString ();
5157 }
5258
5359 return FirebaseException (
5460 plugin: plugin,
55- code: code,
61+ code: code ?? 'unknown' ,
5662 message: message,
5763 );
5864}
You can’t perform that action at this time.
0 commit comments