diff --git a/lib/view_model/widgets_view_models/custom_drawer_view_model.dart b/lib/view_model/widgets_view_models/custom_drawer_view_model.dart index 1daab37b2..4b9923e94 100644 --- a/lib/view_model/widgets_view_models/custom_drawer_view_model.dart +++ b/lib/view_model/widgets_view_models/custom_drawer_view_model.dart @@ -26,7 +26,7 @@ class CustomDrawerViewModel extends BaseModel { /// Instance of TutorialCoachMark responsible for providing tutorial guidance. late TutorialCoachMark tutorialCoachMark; late User _currentUser; - late List _switchAbleOrg; + late List _switchAbleOrg = []; bool _disposed = false; OrgInfo? _selectedOrg; StreamSubscription? _currentOrganizationStreamSubscription; diff --git a/test/view_model_tests/custom_drawer_view_model_test.dart b/test/view_model_tests/custom_drawer_view_model_test.dart index ee24e31ff..de8a3ccf7 100644 --- a/test/view_model_tests/custom_drawer_view_model_test.dart +++ b/test/view_model_tests/custom_drawer_view_model_test.dart @@ -280,5 +280,9 @@ void main() { final model = CustomDrawerViewModel(); expect(model.selectedOrg, isNull); }); + test('switchAbleOrg should be null initially', () { + final model = CustomDrawerViewModel(); + expect(model.switchAbleOrg, []); + }); }); }