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

bug: workout runner screen turns grey #25

Closed
mschmidm opened this issue Feb 27, 2021 · 0 comments
Closed

bug: workout runner screen turns grey #25

mschmidm opened this issue Feb 27, 2021 · 0 comments

Comments

@mschmidm
Copy link
Contributor

Steps to reproduce:

  • Install a fresh version of JAWT (delete data before).
  • create a simple workout with for example one exercise
  • start the workout
    --> workout runner screen turns grey

The following exception is thrown:

======== Exception caught by widgets library =======================================================
The following assertion was thrown building Builder:
Failed assertion: boolean expression must not be null

The relevant error-causing widget was: 
  MaterialApp file:///home/oxq/StudioProjects/just_another_workout_timer/lib/main.dart:21:41
When the exception was thrown, this was the stack: 
#0      _WorkoutPageState.buildTimetable.<anonymous closure>.<anonymous closure> (package:just_another_workout_timer/workout_runner.dart:184:54)
#1      ListMapView.forEach (dart:_internal/list.dart:242:8)
#2      _WorkoutPageState.buildTimetable.<anonymous closure> (package:just_another_workout_timer/workout_runner.dart:128:31)
#3      ListMapView.forEach (dart:_internal/list.dart:242:8)
#4      _WorkoutPageState.buildTimetable (package:just_another_workout_timer/workout_runner.dart:124:27)
...
====================================================================================================

The problem is that some SharedPreferences values (in this case 'halftime') are not set yet and are therefore null. The assertion in workout_runner.dart:184 then throws the exception.
This could be solved by adding a if null operator (??) but I think the cleanest solution is setting the default values in the main() method as done in my pull request.

Kind regards
oxq

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

No branches or pull requests

1 participant