Skip to content

Commit 5534508

Browse files
committed
Check if view attributes property exists before accessing it to avoid silent crash
1 parent bcfa888 commit 5534508

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-native-session-replay/ios/Sources/SvgViewRecorder.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ internal class SvgViewRecorder: SessionReplayNodeRecorder {
7171
}
7272
}
7373

74+
let sel = NSSelectorFromString(SVGConstants.attributes)
75+
guard view.responds(to: sel) else { return nil }
76+
7477
guard let attrs = view.value(forKey: SVGConstants.attributes) as? [String: String] else {
7578
return nil
7679
}

0 commit comments

Comments
 (0)