Skip to content

Commit

Permalink
Return null InlineBoxPosition if no last text box.
Browse files Browse the repository at this point in the history
This patch fixes the crash bug on Android.

Bug: 831057
Change-Id: I94c6a893aad63894609eb34a78bba095596555d6
Reviewed-on: https://chromium-review.googlesource.com/1005636
Reviewed-by: Xiaocheng Hu <[email protected]>
Reviewed-by: Yoichi Osato <[email protected]>
Commit-Queue: Yoichi Osato <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#550563}(cherry picked from commit ab8610e)
Reviewed-on: https://chromium-review.googlesource.com/1013878
Cr-Commit-Position: refs/branch-heads/3396@{#53}
Cr-Branched-From: 9ef2aa8-refs/heads/master@{#550428}
  • Loading branch information
Yoichi Osato authored and xiaochengh committed Apr 17, 2018
1 parent e801fae commit 6615906
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions third_party/blink/renderer/core/editing/local_caret_rect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ InlineBoxPosition NextLinePositionOf(
const LayoutText& layout_text =
ToLayoutTextOrDie(*position.AnchorNode()->GetLayoutObject());
InlineTextBox* const last = layout_text.LastTextBox();
if (!last)
return InlineBoxPosition();
const RootInlineBox& root = last->Root();
const RootInlineBox* const next_root = root.NextRootBox();
if (!next_root)
Expand Down

0 comments on commit 6615906

Please sign in to comment.