do not throw exception if profile doesn't exist
This commit is contained in:
parent
eb8a83d776
commit
c966dfda13
1 changed files with 1 additions and 2 deletions
|
@ -154,8 +154,7 @@ class ProfileFunctionImplementation @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createProfileSwitch(durationInMinutes: Int, percentage: Int, timeShiftInHours: Int): Boolean {
|
override fun createProfileSwitch(durationInMinutes: Int, percentage: Int, timeShiftInHours: Int): Boolean {
|
||||||
val profile = repository.getPermanentProfileSwitch(dateUtil.now())
|
val profile = repository.getPermanentProfileSwitch(dateUtil.now()) ?: return false
|
||||||
?: throw InvalidParameterSpecException("No active ProfileSwitch")
|
|
||||||
val profileStore = activePlugin.activeProfileSource.profile ?: return false
|
val profileStore = activePlugin.activeProfileSource.profile ?: return false
|
||||||
val ps = buildProfileSwitch(profileStore, profile.profileName, durationInMinutes, percentage, 0, dateUtil.now())
|
val ps = buildProfileSwitch(profileStore, profile.profileName, durationInMinutes, percentage, 0, dateUtil.now())
|
||||||
val validity = ProfileSealed.PS(ps).isValid(
|
val validity = ProfileSealed.PS(ps).isValid(
|
||||||
|
|
Loading…
Reference in a new issue