diff --git a/ios/Classes/Base/Callback.swift b/ios/Classes/Base/Callback.swift index 1def7da25..8c5bc130a 100644 --- a/ios/Classes/Base/Callback.swift +++ b/ios/Classes/Base/Callback.swift @@ -25,11 +25,7 @@ extension Callback { } let res = runnable?(code) - if res is Void { - success(nil) - } else { - success(res) - } + success(res) } func resolve(_ source: T?, _ runnable: (T) -> Any?) { @@ -40,10 +36,6 @@ extension Callback { } let res = runnable(source) - if res is Void { - success(nil) - } else { - success(res) - } + success(res) } } diff --git a/ios/Classes/Base/RtcEngine.swift b/ios/Classes/Base/RtcEngine.swift index d0f88f3c0..79850df24 100644 --- a/ios/Classes/Base/RtcEngine.swift +++ b/ios/Classes/Base/RtcEngine.swift @@ -436,7 +436,7 @@ class RtcEngineManager: NSObject, RtcEngineInterface { callback.resolve(engine) { [weak self] _ in self?.Release() RtcEngineRegistry.shared.onRtcEngineDestroyed() - return Void.self + return nil } }