Cocoa Port:

- Fix bug where where nil profile names were unhandled.
- Prevent the user from continuing if a blank profile name is entered.
This commit is contained in:
rogerman 2013-04-04 07:17:18 +00:00
parent 41a4ee009f
commit cc767726aa
2 changed files with 227 additions and 109 deletions

File diff suppressed because it is too large Load Diff

View File

@ -138,6 +138,11 @@
{
NSDictionary *profileDict = [defaultProfileList objectAtIndex:i];
NSString *profileName = (NSString *)[profileDict valueForKey:@"Name"];
if (profileName == nil)
{
profileName = @"";
}
NSMenuItem *newProfileMenuItem = [[[NSMenuItem alloc] initWithTitle:profileName
action:@selector(profileSelect:)
keyEquivalent:@""] autorelease];
@ -164,6 +169,11 @@
{
NSDictionary *profileDict = [savedProfilesList objectAtIndex:i];
NSString *profileName = (NSString *)[profileDict valueForKey:@"Name"];
if (profileName == nil)
{
profileName = @"";
}
NSMenuItem *newProfileMenuItem = [[[NSMenuItem alloc] initWithTitle:profileName
action:@selector(profileSelect:)
keyEquivalent:@""] autorelease];
@ -281,7 +291,13 @@
return;
}
[[inputProfileMenu selectedItem] setTitle:(NSString *)[selectedProfile valueForKey:@"Name"]];
NSString *profileName = (NSString *)[selectedProfile valueForKey:@"Name"];
if (profileName == nil)
{
profileName = @"";
}
[[inputProfileMenu selectedItem] setTitle:profileName];
[[NSUserDefaults standardUserDefaults] setObject:savedProfilesList forKey:@"Input_SavedProfiles"];
}