Skip to content

Commit

Permalink
Use Kotlin precondition instead of guard clause
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxr1998 committed Nov 25, 2019
1 parent f4a5e76 commit 6b23109
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ open class Preference(key: String) : AbstractPreference(key) {
*/
@CallSuper
open fun bindViews(holder: PreferencesAdapter.ViewHolder) {
if (attachedScreen == null)
throw IllegalStateException("Trying to bind view for a preference not attached to a screen!")
checkNotNull(attachedScreen) {
"Trying to bind view for a preference not attached to a screen!"
}

preBindListener?.onPreBind(this, holder)

Expand Down

0 comments on commit 6b23109

Please sign in to comment.