| Index: components/metrics/persisted_logs.cc
|
| diff --git a/components/metrics/persisted_logs.cc b/components/metrics/persisted_logs.cc
|
| index a407a0d46970e04f192011fd047bf7545d84c668..922a296f94742494bb0837e7e291933857530eed 100644
|
| --- a/components/metrics/persisted_logs.cc
|
| +++ b/components/metrics/persisted_logs.cc
|
| @@ -96,14 +96,14 @@ void PersistedLogs::SerializeLogs() const {
|
|
|
| // After writing all the logs to the new pref remove old outdated pref.
|
| // TODO(gayane): Remove when all users are migrated. crbug.com/649440
|
| - if (local_state_->HasPrefPath(outdated_pref_name_))
|
| + if (outdated_pref_name_ && local_state_->HasPrefPath(outdated_pref_name_))
|
| local_state_->ClearPref(outdated_pref_name_);
|
| }
|
|
|
| PersistedLogs::LogReadStatus PersistedLogs::DeserializeLogs() {
|
| // TODO(gayane): Remove the code for reading logs from outdated pref when all
|
| // users are migrated. crbug.com/649440
|
| - if (local_state_->HasPrefPath(outdated_pref_name_)) {
|
| + if (outdated_pref_name_ && local_state_->HasPrefPath(outdated_pref_name_)) {
|
| return ReadLogsFromOldFormatPrefList(
|
| *local_state_->GetList(outdated_pref_name_));
|
| }
|
|
|