diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java index d579c5a49..e754ee05e 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/engine/Session.java @@ -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; } @@ -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) {