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

Commit cc3f73d

Browse files
keianhzobluemarvin
authored andcommitted
Avoid setting state and uri to null when restoring a session (#3629)
1 parent b751725 commit cc3f73d

File tree

1 file changed

+5
-6
lines changed
  • app/src/common/shared/org/mozilla/vrbrowser/browser/engine

1 file changed

+5
-6
lines changed

app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java

+5-6
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ public void suspend() {
431431
}
432432

433433
private boolean shouldLoadDefaultPage(@NonNull SessionState aState) {
434+
// data:text URLs can not be restored.
435+
if (mState.mSessionState != null && ((mState.mUri == null) || mState.mUri.startsWith("data:text"))) {
436+
return true;
437+
}
438+
434439
if (aState.mUri != null && aState.mUri.length() != 0 && !aState.mUri.equals(mContext.getString(R.string.about_blank))) {
435440
return false;
436441
}
@@ -468,12 +473,6 @@ private void restore() {
468473

469474
openSession();
470475

471-
// data:text URLs can not be restored.
472-
if (mState.mSessionState != null && ((mState.mUri == null) || mState.mUri.startsWith("data:text"))) {
473-
mState.mSessionState = null;
474-
mState.mUri = null;
475-
}
476-
477476
if (shouldLoadDefaultPage(mState)) {
478477
loadDefaultPage();
479478
} else if (mState.mSessionState != null) {

0 commit comments

Comments
 (0)