Skip to content

Commit 3773f79

Browse files
committed
fix(ios-exp): skip auto-binding when artboard has no default ViewModel
1 parent f18e6fe commit 3773f79

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

ios/new/RiveReactNativeView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@ class RiveReactNativeView: UIView {
6464
case .none:
6565
dataBind = .none
6666
case .auto:
67-
dataBind = .auto
67+
// Probe for a default ViewModel first. If the artboard has none,
68+
// the SDK would fire an error event — skip auto-binding silently instead.
69+
do {
70+
let _ = try await config.file.getDefaultViewModelInfo(for: artboard)
71+
dataBind = .auto
72+
} catch {
73+
dataBind = .none
74+
}
6875
case .instance(let vmi):
6976
dataBind = .instance(vmi)
7077
case .byName(let name):

0 commit comments

Comments
 (0)