Skip to content

Commit 93daa68

Browse files
Fix #54
1 parent 1ab9278 commit 93daa68

File tree

2 files changed

+2
-2
lines changed
  • viewbinding-ktx/src/main/java/com/dylanc/viewbinding
  • viewbinding-nonreflection-ktx/src/main/java/com/dylanc/viewbinding/nonreflection

2 files changed

+2
-2
lines changed

viewbinding-ktx/src/main/java/com/dylanc/viewbinding/Fragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ inline fun <reified VB : ViewBinding> Fragment.binding(method: Method) =
4040
class FragmentBindingProperty<VB : ViewBinding>(private val clazz: Class<VB>) : ReadOnlyProperty<Fragment, VB> {
4141

4242
override fun getValue(thisRef: Fragment, property: KProperty<*>): VB =
43-
requireNotNull(thisRef.view) { "The property of ${property.name} has been destroyed." }
43+
requireNotNull(thisRef.view) { "The constructor missing layout id or the property of ${property.name} has been destroyed." }
4444
.getBinding(clazz).also { binding ->
4545
if (binding is ViewDataBinding) binding.lifecycleOwner = thisRef.viewLifecycleOwner
4646
}

viewbinding-nonreflection-ktx/src/main/java/com/dylanc/viewbinding/nonreflection/Fragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fun <VB : ViewBinding> Fragment.binding(inflate: (LayoutInflater) -> VB) = Fragm
3636

3737
class FragmentBindingDelegate<VB : ViewBinding>(private val bind: (View) -> VB) : ReadOnlyProperty<Fragment, VB> {
3838
override fun getValue(thisRef: Fragment, property: KProperty<*>): VB =
39-
requireNotNull(thisRef.view) { "The property of ${property.name} has been destroyed." }
39+
requireNotNull(thisRef.view) { "The constructor missing layout id or the property of ${property.name} has been destroyed." }
4040
.getBinding(bind).also { binding ->
4141
if (binding is ViewDataBinding) binding.lifecycleOwner = thisRef.viewLifecycleOwner
4242
}

0 commit comments

Comments
 (0)