Don't save a tab if the url is empty (e.g. a tab that was opened to trigger a download)

This commit is contained in:
Anthony Restaino 2016-09-12 21:29:55 -04:00
parent 6319503973
commit 4d8130db43

View File

@ -10,6 +10,7 @@ import android.os.Bundle;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.webkit.WebView; import android.webkit.WebView;
@ -441,6 +442,9 @@ public class TabsManager {
Log.d(Constants.TAG, "Saving tab state"); Log.d(Constants.TAG, "Saving tab state");
for (int n = 0; n < mTabList.size(); n++) { for (int n = 0; n < mTabList.size(); n++) {
LightningView tab = mTabList.get(n); LightningView tab = mTabList.get(n);
if (TextUtils.isEmpty(tab.getUrl())) {
continue;
}
Bundle state = new Bundle(ClassLoader.getSystemClassLoader()); Bundle state = new Bundle(ClassLoader.getSystemClassLoader());
if (tab.getWebView() != null && !UrlUtils.isSpecialUrl(tab.getUrl())) { if (tab.getWebView() != null && !UrlUtils.isSpecialUrl(tab.getUrl())) {
tab.getWebView().saveState(state); tab.getWebView().saveState(state);