Replaced casting with ObjCCastStrict<> to avoid crashes.
ObjCCastStrict<> returns nil if the object being casted is not of the expected type. This offers a saner behavior when for whatever reasons object is not of the expected type. This is a workaround to avoid a growing crash in iOS 11.3 when an object of UIView type is casted to one of CardView type. A later call to -closeButtonFrame results in an exception (crash). Bug: 393230 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: I6a3f2b66c4ab6a8f268743e1ce8c902ccffaaa05 Reviewed-on: https://chromium-review.googlesource.com/1005562 Commit-Queue: Peter Lee <pkl@chromium.org> Reviewed-by:Rohit Rao <rohitrao@chromium.org> Reviewed-by:
Kurt Horimoto <kkhorimoto@chromium.org> Cr-Commit-Position: refs/heads/master@{#549688}
Showing
Please register or sign in to comment