summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@igalia.com>2019-02-03 20:07:32 -0600
committerMichael Catanzaro <mcatanzaro@igalia.com>2019-02-03 20:07:32 -0600
commite88860e46ae7fde72fced9bc3bbde37657dff048 (patch)
tree45222e60a54c7b908d5ed24e9a85286c21cd77a8
parent0af567d4596d87e3a6829669ebc45c3ba5931692 (diff)
downloadepiphany-e88860e46ae7fde72fced9bc3bbde37657dff048.tar.gz
window: Fix regression from the tab close rework
If data->id == 0 then it's not a valid source and we shouldn't try to remove it.
-rw-r--r--src/ephy-window.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 5d7bb72e8..b3893bf31 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -2774,8 +2774,10 @@ tab_has_modified_forms_cb (EphyWebView *view,
has_modified_forms = ephy_web_view_has_modified_forms_finish (view, result, NULL);
- /* Cancel timer so it doesn't close while waiting for the user. */
- g_source_remove (data->id);
+ if (data->id != 0) {
+ /* Ensure tab doesn't close while waiting for the user. */
+ g_source_remove (data->id);
+ }
if (data->id != 0 &&
data->window != NULL &&