mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
macos: do not quit prefpane unexpectedly
If the user opens the OpenAFS preference pane and choose the Mounts tab, the preference pane crashes. To fix the problem, do not assume that we can cast a NSdictionary object to NSMutableDictionary. Change-Id: I3b5f6cb324a6b53c6b53606f71185f61450ee793 Reviewed-on: https://gerrit.openafs.org/12446 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
parent
3e8529b6ef
commit
9d4be0bd01
@ -166,10 +166,11 @@
|
||||
|
||||
//get link configuration
|
||||
NSData *prefData = (NSData*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_LINK_CONFIGURATION, (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
linkConfiguration = (NSMutableDictionary*)[NSPropertyListSerialization propertyListFromData:prefData
|
||||
mutabilityOption:NSPropertyListMutableContainers
|
||||
format:nil
|
||||
errorDescription:nil];
|
||||
NSDictionary *linkDict = (NSMutableDictionary*)[NSPropertyListSerialization propertyListFromData:prefData
|
||||
mutabilityOption:NSPropertyListMutableContainers
|
||||
format:nil
|
||||
errorDescription:nil];
|
||||
linkConfiguration = [linkDict mutableCopy];
|
||||
|
||||
//get link enabled status
|
||||
NSNumber *linkEnabledStatus = (NSNumber*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_USE_LINK, (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
|
@ -332,10 +332,11 @@
|
||||
|
||||
//link configuration
|
||||
NSData *prefData = (NSData*)CFPreferencesCopyValue((CFStringRef)PREFERENCE_LINK_CONFIGURATION, (CFStringRef)kAfsCommanderID, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
|
||||
linkConfiguration = (NSMutableDictionary*)[NSPropertyListSerialization propertyListFromData:prefData
|
||||
mutabilityOption:NSPropertyListMutableContainers
|
||||
format:nil
|
||||
errorDescription:nil];
|
||||
NSDictionary *linkDict = (NSMutableDictionary*)[NSPropertyListSerialization propertyListFromData:prefData
|
||||
mutabilityOption:NSPropertyListMutableContainers
|
||||
format:nil
|
||||
errorDescription:nil];
|
||||
linkConfiguration = [linkDict mutableCopy];
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user