Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Exception error, when the app starts #207

Closed
Omegaviv opened this issue Mar 11, 2022 · 1 comment · Fixed by #209
Closed

Null Exception error, when the app starts #207

Omegaviv opened this issue Mar 11, 2022 · 1 comment · Fixed by #209

Comments

@Omegaviv
Copy link
Contributor

Describe the bug
When we run the app, there is a null exception error thrown

Log :

D/NetdClient( 2041): netdClientConnect netId:0, uid:10624, nid:0, addr:172.67.69.171, lan:0, localhost:0, sa_family:2, sockfd:88, thread:1.ui
E/flutter ( 2041): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'Null' is not a subtype of type 'bool'
E/flutter ( 2041): #0      new ProjectAttributes.fromJson (package:mobile_app/models/projects.dart:87:24)
E/flutter ( 2041): #1      new Project.fromJson (package:mobile_app/models/projects.dart:24:39)
E/flutter ( 2041): #2      new Projects.fromJson.<anonymous closure> (package:mobile_app/models/projects.dart:8:66)
E/flutter ( 2041): #3      MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
E/flutter ( 2041): #4      ListIterator.moveNext (dart:_internal/iterable.dart:342:26)
E/flutter ( 2041): #5      new List.from (dart:core-patch/array_patch.dart:41:17)
E/flutter ( 2041): #6      new Projects.fromJson (package:mobile_app/models/projects.dart:8:15)
E/flutter ( 2041): #7      HttpProjectsApi.getFeaturedProjects (package:mobile_app/services/API/projects_api.dart:124:23)
E/flutter ( 2041): <asynchronous suspension>
E/flutter ( 2041): #8      FeaturedProjectsViewModel.fetchFeaturedProjects (package:mobile_app/viewmodels/projects/featured_projects_viewmodel.dart:53:41)
E/flutter ( 2041): <asynchronous suspension>
E/flutter ( 2041): 

To Reproduce
Steps to reproduce the behavior:

  1. Run the app in device/emulator
  2. check console log

Are you working on this issue? (Yes/No)
Yes

@Omegaviv
Copy link
Contributor Author

A potential fix could be checking the variable before assigning it, if it is Null we can set it to false.
Is this the correct way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant