Author: fredkiefer
Date: Thu Jan  8 21:36:40 2015
New Revision: 38283

URL: http://svn.gna.org/viewcvs/gnustep?rev=38283&view=rev
Log:
* Source/NSTextView.m: Protect usages of sharedSpellChecker with
  nil tests.
  Patch by Eric Wasylishen <[email protected]>

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/NSTextView.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=38283&r1=38282&r2=38283&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Thu Jan  8 21:36:40 2015
@@ -1,3 +1,9 @@
+2015-01-08  Fred Kiefer <[email protected]>
+
+       * Source/NSTextView.m: Protect usages of sharedSpellChecker with
+       nil tests.
+       Patch by Eric Wasylishen <[email protected]>
+
 2015-01-05 Riccardo Mottola <[email protected]>
 
        * Source/GSToolbarView.m (menuForEvent)

Modified: libs/gui/trunk/Source/NSTextView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSTextView.m?rev=38283&r1=38282&r2=38283&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSTextView.m  (original)
+++ libs/gui/trunk/Source/NSTextView.m  Thu Jan  8 21:36:40 2015
@@ -5873,7 +5873,7 @@
       
       NSSpellChecker *sp = [NSSpellChecker sharedSpellChecker];
       NSString *word = [[self string] substringWithRange: [self 
selectedRange]];
-      if ([sp checkSpellingOfString: word startingAt: 0].location != 
NSNotFound)
+      if (sp != nil && [sp checkSpellingOfString: word startingAt: 0].location 
!= NSNotFound)
        {
          /*NSArray *guesses = [sp guessesForWordRange: wordRange
            inString: [self string]
@@ -6272,6 +6272,11 @@
     // nearest word boundary
     NSString *substring = [[self string] substringWithRange: aRange];
     
+    if (sp == nil)
+      {
+        return;
+      }
+
     do {
       NSRange errorRange = [sp checkSpellingOfString: substring
                                          startingAt: start


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to