Skip to content

Commit c31b359

Browse files
committed
fix(ios): use Result to propagate errors from onMainSync across dispatch boundary
1 parent 62c426b commit c31b359

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ios/new/HybridRiveView.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,13 @@ extension HybridRiveView {
272272
try work()
273273
}
274274
}
275-
return try DispatchQueue.main.sync {
276-
MainActor.assumeIsolated {
277-
try work()
275+
var result: Result<T, Error>!
276+
DispatchQueue.main.sync {
277+
result = MainActor.assumeIsolated {
278+
Result { try work() }
278279
}
279280
}
281+
return try result.get()
280282
}
281283

282284
func logged(tag: String, note: String? = nil, _ fn: () throws -> Void) {

0 commit comments

Comments
 (0)