diff --git a/RxCocoa/Common/Observables/Implementations/KVOObservable.swift b/RxCocoa/Common/Observables/Implementations/KVOObservable.swift index b18f97ea..55a24c54 100644 --- a/RxCocoa/Common/Observables/Implementations/KVOObservable.swift +++ b/RxCocoa/Common/Observables/Implementations/KVOObservable.swift @@ -104,8 +104,7 @@ func observeWeaklyKeyPathFor( let propertyAttributes = property_getAttributes(property) // should dealloc hook be in place if week property, or just create strong reference because it doesn't matter - let propertyAttributesAsString = propertyAttributes == nil ? "" : String(cString: propertyAttributes!) - let isWeak = isWeakProperty(propertyAttributesAsString) + let isWeak = isWeakProperty(propertyAttributes.map(String.init) ?? "") let propertyObservable = KVOObservable(object: target, keyPath: propertyName, options: options.union(.initial), retainTarget: false) as KVOObservable // KVO recursion for value changes