Revision: 2919
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2919&view=rev
Author:   hofman
Date:     2007-09-13 09:49:57 -0700 (Thu, 13 Sep 2007)

Log Message:
-----------
Add a try-block when setting icon and text, because editing may pass a string 
to this method.

Modified Paths:
--------------
    trunk/SKTextWithIconCell.m

Modified: trunk/SKTextWithIconCell.m
===================================================================
--- trunk/SKTextWithIconCell.m  2007-09-13 16:43:33 UTC (rev 2918)
+++ trunk/SKTextWithIconCell.m  2007-09-13 16:49:57 UTC (rev 2919)
@@ -121,8 +121,17 @@
 }
 
 - (void)setObjectValue:(id<NSCopying>)obj {
-    [self setIcon:[(id)obj valueForKey:SKTextWithIconCellImageKey]];
-    [super setObjectValue:[(id)obj valueForKey:SKTextWithIconCellStringKey]];
+    NSImage *image;
+    NSString *string;
+    @try {
+        image = [(id)obj valueForKey:SKTextWithIconCellImageKey];
+        string = [(id)obj valueForKey:SKTextWithIconCellStringKey];
+        [self setIcon:image];
+        [super setObjectValue:string];
+    }
+    @catch (id exception) {
+        [super setObjectValue:obj];
+    }
 }
 
 // API


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to