Check if widget is mounted before calling setstate() (#193)

This commit is contained in:
Oliver 2022-07-29 20:01:06 +10:00 committed by GitHub
parent b7a37e50c5
commit c5162c1947
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 29 deletions

View file

@ -177,7 +177,9 @@ class _InvenTreeHomePageState extends State<InvenTreeHomePage> {
// Attempt server connection
InvenTreeAPI().connectToServer().then((result) {
setState(() {});
if (mounted) {
setState(() {});
}
});
}
}