Non-strict cast in showCustomInputAccessoryView:
FormInputAccessoryViewController's -showCustomInputAccessoryView: intends to
handle the case when the view is a suggestion view and there are no
suggestions by not showing the view.
The code seems to have this pattern:
try to cast the view into a suggestion view
if (succeeded in the cast) {
handle the 0-suggestion case
}
Also, https://codereview.chromium.org/1310813002 which introduced this code has a
description indicating that the non-suggestion-view case should be handled
gracefully.
Yet, the code uses ObjCCastStrict instead of ObjCCast. The strict cast DCHECKs
that the casted object is indeed of the target type, whereas the non-strict
cast just returns nil if it is not.
Given the above, it seems more appropriate to use the non-strict cast, which
is done in this CL.
BUG=634245
R=jdonnelly@chromium.org
Review-Url: https://codereview.chromium.org/2213383003
Cr-Commit-Position: refs/heads/master@{#410394}
Showing
Please register or sign in to comment