diff --git a/atom/common/asar/archive.cc b/atom/common/asar/archive.cc index 5684f95f6d72..1da683c21302 100644 --- a/atom/common/asar/archive.cc +++ b/atom/common/asar/archive.cc @@ -186,16 +186,15 @@ bool Archive::Init() { return false; } - std::string error; - base::JSONReader reader; - std::unique_ptr value(reader.ReadToValue(header)); + base::Optional value = base::JSONReader::Read(header); if (!value || !value->is_dict()) { - LOG(ERROR) << "Failed to parse header: " << error; + LOG(ERROR) << "Failed to parse header"; return false; } header_size_ = 8 + size; - header_.reset(static_cast(value.release())); + header_ = base::DictionaryValue::From( + std::make_unique(value->Clone())); return true; }