REGRESSION (r258525): Occasional crashes under TextManipulationController::observeParagraphs
https://bugs.webkit.org/show_bug.cgi?id=210215
<rdar://problem/61362512>

Reviewed by Darin Adler.

In the case where `startOfParagraph` or `endOfParagraph` return a null `Position`, we end up crashing under
TextManipulationController::observeParagraphs while creating `ParagraphContentIterator`, which expects non-null
`Position`s because it dereferences the result of `makeBoundaryPoint`.

Avoid this crash for now by bailing if either the start or end positions are null. Tests to be added in a
followup patch.

* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@259766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/editing/TextManipulationController.cpp b/Source/WebCore/editing/TextManipulationController.cpp
index b94773c..dbee645 100644
--- a/Source/WebCore/editing/TextManipulationController.cpp
+++ b/Source/WebCore/editing/TextManipulationController.cpp
@@ -239,6 +239,9 @@
 
 void TextManipulationController::observeParagraphs(const Position& start, const Position& end)
 {
+    if (start.isNull() || end.isNull())
+        return;
+
     auto document = makeRefPtr(start.document());
     ASSERT(document);
     ParagraphContentIterator iterator { start, end };