]> granicus.if.org Git - handbrake/commitdiff
MacGui: fix a crash in the preferences format field.
authorDamiano Galassi <damiog@gmail.com>
Wed, 21 Sep 2016 16:38:18 +0000 (18:38 +0200)
committerDamiano Galassi <damiog@gmail.com>
Wed, 21 Sep 2016 16:41:47 +0000 (18:41 +0200)
macosx/HBPreferencesController.m

index 14f988db6150452290f9e1db146e40cd45e37789..d125782bdd70776bae68d665a74ccfa7153c84f9 100644 (file)
 
 - (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)];
     }