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

This commit is contained in:
Oliver authored and GitHub committed 2022-07-29 20:01:06 +10:00
1 parent b7a37e50c5
commit c5162c1947
6 files changed
+48 -29

No files matched your search

+3 -2
View File
@@ -46,8 +46,9 @@ class _InvenTreeAppSettingsState extends State<InvenTreeAppSettingsWidget> {
reportErrors = await InvenTreeSettingsManager().getValue(INV_REPORT_ERRORS, true) as bool;
strictHttps = await InvenTreeSettingsManager().getValue(INV_STRICT_HTTPS, false) as bool;
setState(() {
});
if (mounted) {
setState(() {});
}
}
@override