<rdar://problem/5625327> Crash toggling check grammar w/ spelling when no...
authorsfalken@apple.com <sfalken@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Dec 2007 01:36:35 +0000 (01:36 +0000)
committersfalken@apple.com <sfalken@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Dec 2007 01:36:35 +0000 (01:36 +0000)
        Reviewed by Adam.

        * WebView.cpp:
        (WebView::setGrammarCheckingEnabled): Add null check

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28466 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/win/ChangeLog
WebKit/win/WebView.cpp

index eb0edac7305a6ac67b418b94cea9d0dfd1aecdaa..79dd873aa70e9ed3cdd7db14e49a9b5c9d8c781b 100644 (file)
@@ -1,3 +1,12 @@
+2007-12-05  Steve Falkenburg  <sfalken@apple.com>
+
+        <rdar://problem/5625327> Crash toggling check grammar w/ spelling when no spell checker exists.
+        
+        Reviewed by Adam.
+
+        * WebView.cpp:
+        (WebView::setGrammarCheckingEnabled): Add null check
+
 2007-12-05  Adam Roben  <aroben@apple.com>
 
         Expose WebView::setProhibitsMainFrameScrolling through IWebViewPrivate
 2007-12-05  Adam Roben  <aroben@apple.com>
 
         Expose WebView::setProhibitsMainFrameScrolling through IWebViewPrivate
index 5aa7d4e2d3f2dcbcdfc94d13be8fdd6392390f29..a064feacaf29adfb6a0ab5b93b8be10ef3dff3c6 100644 (file)
@@ -3340,6 +3340,11 @@ HRESULT STDMETHODCALLTYPE WebView::isGrammarCheckingEnabled(
 HRESULT STDMETHODCALLTYPE WebView::setGrammarCheckingEnabled( 
     BOOL enabled)
 {
 HRESULT STDMETHODCALLTYPE WebView::setGrammarCheckingEnabled( 
     BOOL enabled)
 {
+    if (!m_editingDelegate) {
+        LOG_ERROR("No NSSpellChecker");
+        return E_FAIL;
+    }
+
     if (grammarCheckingEnabled == !!enabled)
         return S_OK;
     
     if (grammarCheckingEnabled == !!enabled)
         return S_OK;