fix: about panel crash (#37373)

* fix: about panel is a base::Value::Dict

* nix this test for a diff PR
This commit is contained in:
Calvin 2023-02-28 15:26:00 -07:00 committed by GitHub
parent 3a5ae28c95
commit 2e03bdb9b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 29 deletions

View file

@ -513,8 +513,7 @@ void Browser::DockSetIcon(v8::Isolate* isolate, v8::Local<v8::Value> icon) {
}
void Browser::ShowAboutPanel() {
NSDictionary* options =
DictionaryValueToNSDictionary(about_panel_options_.GetDict());
NSDictionary* options = DictionaryValueToNSDictionary(about_panel_options_);
// Credits must be a NSAttributedString instead of NSString
NSString* credits = (NSString*)options[@"Credits"];
@ -537,13 +536,13 @@ void Browser::ShowAboutPanel() {
}
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
about_panel_options_.GetDict().clear();
about_panel_options_.clear();
for (const auto pair : options) {
std::string key = pair.first;
if (!key.empty() && pair.second.is_string()) {
key[0] = base::ToUpperASCII(key[0]);
about_panel_options_.GetDict().Set(key, pair.second.Clone());
about_panel_options_.Set(key, pair.second.Clone());
}
}
}