[43765] users/toby/objcports/MPParser.m

toby at macports.org toby at macports.org
Sun Dec 14 01:49:31 PST 2008


Revision: 43765
          http://trac.macports.org/changeset/43765
Author:   toby at macports.org
Date:     2008-12-14 01:49:29 -0800 (Sun, 14 Dec 2008)
Log Message:
-----------
avoid crashing when option isn't set

Modified Paths:
--------------
    users/toby/objcports/MPParser.m

Modified: users/toby/objcports/MPParser.m
===================================================================
--- users/toby/objcports/MPParser.m	2008-12-14 09:06:10 UTC (rev 43764)
+++ users/toby/objcports/MPParser.m	2008-12-14 09:49:29 UTC (rev 43765)
@@ -57,7 +57,8 @@
 
 - (NSString *)option:(NSString *)option
 {
-	return [NSString stringWithUTF8String:Tcl_GetVar(_interp, [option UTF8String], 0)];
+	const char *val = Tcl_GetVar(_interp, [option UTF8String], 0);
+	return val ? [NSString stringWithUTF8String:val] : nil;
 }
 
 - (NSArray *)variants
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081214/6296e83d/attachment.html>


More information about the macports-changes mailing list