Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Avoid setting state and uri to null when restoring a session (#3629)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Jul 6, 2020
1 parent b751725 commit cc3f73d
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ public void suspend() {
}

private boolean shouldLoadDefaultPage(@NonNull SessionState aState) {
// data:text URLs can not be restored.
if (mState.mSessionState != null && ((mState.mUri == null) || mState.mUri.startsWith("data:text"))) {
return true;
}

if (aState.mUri != null && aState.mUri.length() != 0 && !aState.mUri.equals(mContext.getString(R.string.about_blank))) {
return false;
}
Expand Down Expand Up @@ -468,12 +473,6 @@ private void restore() {

openSession();

// data:text URLs can not be restored.
if (mState.mSessionState != null && ((mState.mUri == null) || mState.mUri.startsWith("data:text"))) {
mState.mSessionState = null;
mState.mUri = null;
}

if (shouldLoadDefaultPage(mState)) {
loadDefaultPage();
} else if (mState.mSessionState != null) {
Expand Down

0 comments on commit cc3f73d

Please sign in to comment.