[Android] Check folder existence before setting title in Edit activity.
commit81d10d73117956f51dc9b5a44e232cdc3f7d11d2
authorkkimlabs <kkimlabs@chromium.org>
Tue, 18 Aug 2015 19:18:22 +0000 (18 12:18 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 18 Aug 2015 19:19:26 +0000 (18 19:19 +0000)
treed2e488d31c6fc86631e8cf3b2122dc3eabe15d10
parent1cac67e2ff0f6469729162077f6e541a4fa5a7a9
[Android] Check folder existence before setting title in Edit activity.

When a folder is deleted in EnhancedBookmarkAddEditFolderActivity,
we listen to the bookmark model change and dismiss the activity if it
is deleted. However, at onStop(), we were always trying to save the
folder title, and if it was deleted already, it crashed.

Fix the crash by simply adding an existence check before we save the
title.

BUG=522046

Review URL: https://codereview.chromium.org/1300843004

Cr-Commit-Position: refs/heads/master@{#343993}
chrome/android/java/src/org/chromium/chrome/browser/enhancedbookmarks/EnhancedBookmarkAddEditFolderActivity.java