fixes from code review
This commit is contained in:
parent
5e51ab9791
commit
c5aeda1fdd
3 changed files with 18 additions and 18 deletions
|
@ -146,13 +146,13 @@ v8::Local<v8::Value> SystemPreferences::GetUserDefault(
|
|||
|
||||
void SystemPreferences::RegisterDefaults(mate::Arguments* args) {
|
||||
base::DictionaryValue value;
|
||||
if (!args->GetNext(&value)) {
|
||||
args->ThrowError("Unable to parse userDefaults dict");
|
||||
return;
|
||||
}
|
||||
|
||||
if (NSDictionary* dict = DictionaryValueToNSDictionary(value)) {
|
||||
args->GetNext(&value);
|
||||
|
||||
@try {
|
||||
NSDictionary* dict = DictionaryValueToNSDictionary(value);
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
|
||||
} @catch (NSException* exception) {
|
||||
args->ThrowError("Invalid userDefault data provided");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue