Small nullability check in manager.dart for null working directory (#17)

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 12:19:08 +00:00 committed by GitHub
parent 692825c0ee
commit 5ddb7f80e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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.