Skip to content

Commit cdecbc2

Browse files
committed
Fixed no snackbar when user was added
The reason was portController text may be empty and this throws error in int.parse() function.
1 parent 80d49b2 commit cdecbc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Pages/settings_screen.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,11 @@ class AuthenticationSection extends StatelessWidget {
763763
level: isAdmin ? 10 : 5,
764764
path: pathController.text,
765765
host: hostController.text,
766-
port: int.parse(portController.text),
766+
port: int.parse(
767+
portController.text.isEmpty
768+
? "0"
769+
: portController.text,
770+
),
767771
),
768772
);
769773
final addNewUserSnackBar = addFloodSnackBar(

0 commit comments

Comments
 (0)