summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfgorski <fgorski@chromium.org>2016-02-03 17:07:07 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-04 01:09:41 +0000
commit99a56db117393aae448d2b2f5c32ef5529a13f60 (patch)
treea6ff17dd81502cb38e02302a8e3eec2abb7f0148
parent3bde47dff9fe951e18bdf71de95e358c84fcb7f1 (diff)
downloadchromium_src-99a56db117393aae448d2b2f5c32ef5529a13f60.zip
chromium_src-99a56db117393aae448d2b2f5c32ef5529a13f60.tar.gz
chromium_src-99a56db117393aae448d2b2f5c32ef5529a13f60.tar.bz2
[Offline page] Fixing the crash when bookmark editor accesses destroyed web contents
When a tab is closed, while the bookmark editor is opened and carries web contents related to the page, we may hit a crash when trying to access that web contents as it is gone by then. Checking for isDestroyed seems to be the way to go. BUG=583605 Review URL: https://codereview.chromium.org/1663543005 Cr-Commit-Position: refs/heads/master@{#373406}
-rw-r--r--chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkEditActivity.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkEditActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkEditActivity.java
index ba95db9..c70e260 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkEditActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkEditActivity.java
@@ -265,7 +265,7 @@ public class EnhancedBookmarkEditActivity extends EnhancedBookmarkActivityBase {
R.string.offline_pages_as_bookmarks_offline_page_size),
Formatter.formatFileSize(this, offlinePage.getFileSize())));
updateButtonToDeleteOfflinePage(saveRemoveVisitButton);
- } else if (mWebContents != null
+ } else if (mWebContents != null && !mWebContents.isDestroyed()
&& offlinePageBridge.canSavePage(mWebContents.getLastCommittedUrl())) {
// Offline page is not saved, but a bookmarked page is opened. Show save button.
offlinePageInfoTextView.setText(