From 2ab78754a9d0c6a3a56363d908edbc537cc5d259 Mon Sep 17 00:00:00 2001 From: KH Lau Date: Fri, 9 Mar 2018 11:32:38 +0800 Subject: [PATCH] BrowserWindow.vala --- BrowserWindow.vala | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/BrowserWindow.vala b/BrowserWindow.vala index 77f7dc1..e45e215 100644 --- a/BrowserWindow.vala +++ b/BrowserWindow.vala @@ -419,15 +419,19 @@ public class BrowserWindow : Object } public void delete_cookiefile () { - print("deleting tmp file %s\n",_this.cookie_file); - File file = File.new_for_path (_this.cookie_file); - try { - if (file.query_exists () == true) { - file.delete (); + // _this -> owner BrowserWindow + // cookie_file is created by BrowserWindow + if(_this.cookie_file.length >0 ){ + print("deleting tmp file %s\n",_this.cookie_file); + File file = File.new_for_path (_this.cookie_file); + try { + if (file.query_exists () == true) { + file.delete (); + } + } catch (Error e) { + stdout.printf ("Error: %s\n", e.message); } - } catch (Error e) { - stdout.printf ("Error: %s\n", e.message); - } + } } } -- 2.39.2