Skip to content

Commit

Permalink
FIX: app does not crash with faulty settings, falls back to default i…
Browse files Browse the repository at this point in the history
…nstead
  • Loading branch information
ede1998 committed Apr 10, 2020
1 parent 4c0e73f commit 55e23ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ android {
applicationId "me.erikhennig.worktracks"
minSdkVersion 26
targetSdkVersion 29
versionCode 4
versionName "1.2.1"
versionCode 5
versionName "1.2.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ public static Duration getWeeklyWorkDuration(Context context) {

private static Duration getWeeklyWorkDuration(SharedPreferences preferences) {
String duration = preferences.getString(WEEKLY_WORK_DURATION, "37:00");

try {
return chronoFormatter.parseDuration(duration);
} catch (DateTimeParseException e) {
return null;
return Duration.ofHours(37);
}
}

Expand Down

0 comments on commit 55e23ed

Please sign in to comment.