<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - VisibleSelection should only accept Range by reference"
   href="https://bugs.webkit.org/show_bug.cgi?id=144047#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - VisibleSelection should only accept Range by reference"
   href="https://bugs.webkit.org/show_bug.cgi?id=144047">bug 144047</a>
              from <span class="vcard"><a class="email" href="mailto:bfulgham&#64;webkit.org" title="Brent Fulgham &lt;bfulgham&#64;webkit.org&gt;"> <span class="fn">Brent Fulgham</span></a>
</span></b>
        <pre>It's interesting (alarming?) that there are cases in the same file (e.g., WebPage.cpp) where null checks are performed, and others where it is missed:

Example 1: (WebPage.cpp Line 4207)
void WebPage::insertTextAsync(const String&amp; text, const EditingRange&amp; replacementEditingRange, bool registerUndoGroup)

        RefPtr&lt;Range&gt; replacementRange = rangeFromEditingRange(frame, replacementEditingRange);
        if (replacementRange)
            frame.selection().setSelection(VisibleSelection(replacementRange.get(), SEL_DEFAULT_AFFINITY));


Example 2: (WebPage.cpp Line 4296)
void WebPage::setCompositionAsync(const String&amp; text, Vector&lt;CompositionUnderline&gt; underlines, const EditingRange&amp; selection, const EditingRange&amp; replacementEditingRange)

        replacementRange = rangeFromEditingRange(frame, replacementEditingRange);
        frame.selection().setSelection(VisibleSelection(replacementRange.get(), SEL_DEFAULT_AFFINITY));</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>