From 3f3f117901a480aa8284dd0cb06ceedd39f4fcb3 Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Fri, 9 Jun 2006 21:45:25 +0000 Subject: [PATCH] Bug 337002: NS_ERROR_FILE_NOT_FOUND error is dumped to console sometimes from sss_clearDisk, patch by logan , r=dietrich git-svn-id: svn://10.0.0.236/trunk@199640 18797224-902f-48f8-a5cc-f745e15eee43 --- .../sessionstore/src/nsSessionStore.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/mozilla/browser/components/sessionstore/src/nsSessionStore.js b/mozilla/browser/components/sessionstore/src/nsSessionStore.js index 815b2d985d0..35beb7cdef0 100644 --- a/mozilla/browser/components/sessionstore/src/nsSessionStore.js +++ b/mozilla/browser/components/sessionstore/src/nsSessionStore.js @@ -1672,14 +1672,22 @@ SessionStoreService.prototype = { * delete session datafile and backup */ _clearDisk: function sss_clearDisk() { - try { - this._getSessionFile().remove(false); + var file = this._getSessionFile(); + + if (file.exists()) { + try { + file.remove(false); + } + catch (ex) { dump(ex + '\n'); } // couldn't remove the file - what now? } - catch (ex) { dump(ex); } // couldn't remove the file - what now? + + if (!this._lastSessionCrashed) + return; + try { this._getSessionFile(true).remove(false); } - catch (ex) { dump(ex); } // couldn't remove the file - what now? + catch (ex) { dump(ex + '\n'); } // couldn't remove the file - what now? }, /**