-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[local_auth] Fix iOS crash when no localizedReason #3780
Changes from 2 commits
25bead8
64db76c
52bfb1d
60c4e52
4f83842
2f8a09a
8e3fe6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,6 +101,8 @@ class LocalAuthentication { | |
| bool biometricOnly = false, | ||
| }) async { | ||
| assert(localizedReason != null); | ||
|
||
| assert(localizedReason.isNotEmpty); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the behavior on android if this is empty?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Android 11 (simulator) there are no problems if the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. If android can handle null, especially if null and empty string means different things on android, we should allow null on android. Do you know if there are difference between null and empty string on android?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at this again. I think you are right, we really shouldn't allow empty strings or null on android either. So the change looks good.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @enricobenedos Let's make sure to mention the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @cyanglaz, sorry for the delay but I'm a little bit busy. I'm happy that you check that is it a good idea to also not give the possibility to input an empty string on Android. I will update the docs soon.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome! Thanks, once you update the doc we will land this!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated the |
||
|
|
||
| final Map<String, Object> args = <String, Object>{ | ||
| 'localizedReason': localizedReason, | ||
| 'useErrorDialogs': useErrorDialogs, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.