summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreferencesController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-09-21 18:38:18 +0200
committerDamiano Galassi <[email protected]>2016-09-21 18:41:47 +0200
commitb154660968a1203a870b5fecdd940329efc25768 (patch)
tree672b6ef37537630441fe313acdaa8f43bdf4bc1c /macosx/HBPreferencesController.m
parent8729a0fefffd31935cd9034aa10587a36c9a52cf (diff)
MacGui: fix a crash in the preferences format field.
Diffstat (limited to 'macosx/HBPreferencesController.m')
-rw-r--r--macosx/HBPreferencesController.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/macosx/HBPreferencesController.m b/macosx/HBPreferencesController.m
index 14f988db6..d125782bd 100644
--- a/macosx/HBPreferencesController.m
+++ b/macosx/HBPreferencesController.m
@@ -219,7 +219,7 @@
- (NSString *)tokenField:(NSTokenField *)tokenField displayStringForRepresentedObject:(id)representedObject
{
- if ([representedObject rangeOfString: @"{"].location == 0)
+ if ([representedObject rangeOfString: @"{"].location == 0 && [representedObject length] > 1)
{
return [(NSString *)representedObject substringWithRange:NSMakeRange(1, [(NSString*)representedObject length]-2)];
}