Skip to content

Commit

Permalink
fix: Handle corrupted device profiles instead of crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed May 23, 2023
1 parent 873f0b0 commit cf6eb31
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ class ProfileManager : BroadcastReceiver(), RoutingObserver.RoutingChangedCallba
Timber.e("Illegal state: preset does not exist")
Timber.i(ex)
}
catch (ex: Exception) {
Timber.e("Preset is corrupted")
Timber.i(ex)
}
}
}
}
Expand Down Expand Up @@ -155,6 +159,11 @@ class ProfileManager : BroadcastReceiver(), RoutingObserver.RoutingChangedCallba
Timber.i(ex)
context.restoreDspSettings()
}
catch (ex: Exception) {
Timber.e("Profile is corrupted")
Timber.i(ex)
context.restoreDspSettings()
}

profile.save(File(getProfileDirectory(null), FILE_PROFILE))
}
Expand Down

0 comments on commit cf6eb31

Please sign in to comment.