chore: if user cancels image selection in user settings page, don't reset selected avatar
This commit is contained in:
parent
2961d8e277
commit
91b27b589d
1 changed files with 4 additions and 0 deletions
|
|
@ -135,6 +135,10 @@ class UserSettingsState extends State<UserSettingsPage> {
|
|||
final bytes = await selectedFile?.readAsBytes();
|
||||
final path = selectedFile?.path;
|
||||
|
||||
if (bytes == null || path == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
selectedAvatarPath = null;
|
||||
avatar = bytes;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue