Skip to content

Commit

Permalink
Merge pull request #658 from brave/maxk-fix-crash-downloading
Browse files Browse the repository at this point in the history
Fixes crashes when downloading an item (repro'd with a .crx)
  • Loading branch information
bbondy committed Oct 17, 2018
1 parent e0dc2c5 commit cf050f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion browser/ui/views/download/brave_download_item_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ void BraveDownloadItemView::OnDownloadUpdated(
download::DownloadItem* download) {
// Check for conditions that would disregard origin url change and fall back
// onto base implementation to handle them.
if (!model_.ShouldShowInShelf()) {
if (!model_.ShouldShowInShelf() ||
(DownloadItemView::download()->GetState() == DownloadItem::COMPLETE &&
model_.ShouldRemoveFromShelfWhenComplete())) {
DownloadItemView::OnDownloadUpdated(download);
return;
}
Expand Down

0 comments on commit cf050f4

Please sign in to comment.