Small nullability check in manager.dart for null working directory

This squashes a potential bad interaction on initial launch that causes at the least a message in the terminal about using a null value instead of string.
This commit is contained in:
Dani Llewellyn 2021-11-12 11:39:41 +00:00
parent 78a681ac76
commit d300c3b128
No known key found for this signature in database
GPG Key ID: C75969D9238A4A8E
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,9 @@ class _ManagerState extends State<Manager> with PreferencesMixin {
super.initState();
getPreference<String>(prefWorkingDirectory).then((pref) {
setState(() {
if (pref == null) {
return;
}
Directory.current = pref;
});
Future.delayed(Duration.zero, () => _getVms(context)); // Reload VM list when we enter the page.