Commit 30feaa28 authored by v.paturi's avatar v.paturi Committed by Commit Bot

[LayoutNG] Add null check for return value of ContainingNGBlockFlow().

The function ContainingNGBlockFlow() might return a nullptr.
So add a null check before dereferencing the pointer returned
by it.

Bug: None
Change-Id: Ib4c3f84166654ec7af3bc187190714f2c3ab2bee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1505352Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Reviewed-by: default avatarPrashant Nevase <prashant.n@samsung.com>
Commit-Queue: Prashant Nevase <prashant.n@samsung.com>
Cr-Commit-Position: refs/heads/master@{#638089}
parent a3700b9b
......@@ -83,9 +83,9 @@ NGLogicalRect ExpandedSelectionRectForSoftLineBreakIfNeeded(
// this fragment is at the end of line.
if (selection_status.line_break == SelectSoftLineBreak::kNotSelected)
return rect;
if (paint_fragment.GetLayoutObject()
->ContainingNGBlockFlow()
->ShouldTruncateOverflowingText())
LayoutBlockFlow* layout_block_flow =
paint_fragment.GetLayoutObject()->ContainingNGBlockFlow();
if (layout_block_flow && layout_block_flow->ShouldTruncateOverflowingText())
return rect;
// Copy from InlineTextBoxPainter::PaintSelection.
const LayoutUnit space_width(paint_fragment.Style().GetFont().SpaceWidth());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment