Chromium Code Reviews| Index: chrome/browser/media/tab_desktop_media_list.cc |
| diff --git a/chrome/browser/media/tab_desktop_media_list.cc b/chrome/browser/media/tab_desktop_media_list.cc |
| index 76a1bb839512bbec99851123f95a128613097068..288f7e3315496aebb7b5d4ecc150b9e121b6e898 100644 |
| --- a/chrome/browser/media/tab_desktop_media_list.cc |
| +++ b/chrome/browser/media/tab_desktop_media_list.cc |
| @@ -73,6 +73,9 @@ void TabDesktopMediaList::Refresh() { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| Profile* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy(); |
| + if (!profile) |
| + return; |
|
Sergey Ulanov
2016/08/20 01:08:48
I think ScheduleNextRefresh still need to be poste
afakhry
2016/08/20 01:33:52
Done.
|
| + |
| std::vector<Browser*> browsers; |
| for (auto* browser : *BrowserList::GetInstance()) { |
| if (browser->profile()->GetOriginalProfile() == |
| @@ -130,9 +133,9 @@ void TabDesktopMediaList::Refresh() { |
| favicon_hashes_ = new_favicon_hashes; |
| // Sort tab sources by time. Most recent one first. Then update sources list. |
| - for (auto it = tab_map.rbegin(); it != tab_map.rend(); ++it) { |
| + for (auto it = tab_map.rbegin(); it != tab_map.rend(); ++it) |
| sources.push_back(it->second); |
| - } |
| + |
| UpdateSourcesList(sources); |
| for (const auto& it : favicon_pairs) { |