diff --git a/orx-jvm/orx-file-watcher/src/main/kotlin/FileWatcherDelegate.kt b/orx-jvm/orx-file-watcher/src/main/kotlin/FileWatcherDelegate.kt index 54453a70..3330a72f 100644 --- a/orx-jvm/orx-file-watcher/src/main/kotlin/FileWatcherDelegate.kt +++ b/orx-jvm/orx-file-watcher/src/main/kotlin/FileWatcherDelegate.kt @@ -25,7 +25,7 @@ class FileWatcherDelegate( } } - operator fun getValue(any: Any, property: KProperty<*>): T { + operator fun getValue(any: Any?, property: KProperty<*>): T { return value } } diff --git a/orx-property-watchers/src/commonMain/kotlin/PropertyWatcherDelegates.kt b/orx-property-watchers/src/commonMain/kotlin/PropertyWatcherDelegates.kt index ac1c845c..70087bce 100644 --- a/orx-property-watchers/src/commonMain/kotlin/PropertyWatcherDelegates.kt +++ b/orx-property-watchers/src/commonMain/kotlin/PropertyWatcherDelegates.kt @@ -16,7 +16,7 @@ class PropertyWatcherDelegate( ) { private var watchValue: V? = null private var value: R? = null - operator fun getValue(any: Any, property: KProperty<*>): R { + operator fun getValue(any: Any?, property: KProperty<*>): R { val ref = this.property.get() if (watchValue != ref) { watchValue = ref @@ -27,6 +27,7 @@ class PropertyWatcherDelegate( } return value ?: error("no value?") } + } /** @@ -42,7 +43,7 @@ class PropertyWatcherDelegate2( private var watchValue0: V0? = null private var watchValue1: V1? = null private var value: R? = null - operator fun getValue(any: Any, property: KProperty<*>): R { + operator fun getValue(any: Any?, property: KProperty<*>): R { val ref0 = toWatch0.get() val ref1 = toWatch1.get() if (watchValue0 != ref0 || watchValue1 != ref1) { @@ -73,7 +74,7 @@ class PropertyWatcherDelegate3( private var watchValue1: V1? = null private var watchValue2: V2? = null private var value: R? = null - operator fun getValue(any: Any, property: KProperty<*>): R { + operator fun getValue(any: Any?, property: KProperty<*>): R { val ref0 = toWatch0.get() val ref1 = toWatch1.get() val ref2 = toWatch2.get()