Skip to content

Commit 138b05a

Browse files
author
Rijuth Menon
committed
fixed default profile being null issue
1 parent 195a20d commit 138b05a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

lib/app/modules/home/controllers/home_controller.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,21 @@ class HomeController extends GetxController {
232232
String profileName = await storage.readProfile();
233233
selectedProfile.value = profileName;
234234
ProfileModel? p = await IsarDb.getProfile(profileName);
235-
profileModel.value = p!;
235+
if (p != null)
236+
{
237+
profileModel.value = p!;
238+
}
239+
236240
}
237241

238242
void writeProfileName(String name) async {
239243
await storage.writeProfile(name);
240244
selectedProfile.value = name;
241245
ProfileModel? p = await IsarDb.getProfile(name);
242-
profileModel.value = p!;
246+
if (p != null)
247+
{
248+
profileModel.value = p!;
249+
}
243250
}
244251

245252
@override

0 commit comments

Comments
 (0)