summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2021-02-24 11:32:07 -0600
committerJan-Michael Brummer <jan.brummer@tabos.org>2021-04-05 09:36:48 +0000
commitcd3404021f21dc0e8f8b41fe23261631d5cc0040 (patch)
tree777b81a54be284d43865c6eabf9157fcdcdf515b
parent6dd3ac6bb722ae4e6a9a0f69c313d6d6810563f4 (diff)
downloadepiphany-cd3404021f21dc0e8f8b41fe23261631d5cc0040.tar.gz
session: return earlier if no page has been loaded
There is no need to bother creating the SaveData object in this case.
-rw-r--r--src/ephy-session.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ephy-session.c b/src/ephy-session.c
index b106e0b4e..5dda793ba 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -997,6 +997,9 @@ ephy_session_save_timeout_cb (EphySession *session)
session->save_source_id = 0;
+ if (!session->loaded_page)
+ return G_SOURCE_REMOVE;
+
/* If we have never successfully loaded any page, or any web view has an
* insane URL, then something has probably gone wrong inside WebKit. For
* instance, if the web process is nonfunctional, the UI process could have
@@ -1005,7 +1008,7 @@ ephy_session_save_timeout_cb (EphySession *session)
* file with our new bogus state. Bug #768250.
*/
data = save_data_new (session);
- if (!session->loaded_page || !session_seems_reasonable (data->windows)) {
+ if (!session_seems_reasonable (data->windows)) {
save_data_free (data);
return G_SOURCE_REMOVE;
}