diff --git a/c_micasad/lss/LocalStorage.cs b/c_micasad/lss/LocalStorage.cs index 9b4ffc43..694fd4a3 100644 --- a/c_micasad/lss/LocalStorage.cs +++ b/c_micasad/lss/LocalStorage.cs @@ -103,8 +103,18 @@ namespace sscs.lss try { string fileName = userStore.GetPersistenceFilePath(); - if(!File.Exists(fileName)) - return null; + if(!File.Exists(fileName)) + { + // check for tmp file + if (File.Exists(fileName+".tmp")) + File.Move(fileName+".tmp", fileName); + else + return null; + } + + // delete tmp file if there + if (File.Exists(fileName+".tmp")) + File.Delete(fileName+".tmp"); byte[] baPasscode = CASACrypto.GetMasterPasscode(userStore.GetDesktopPasswd(),userStore.GetPasscodeByDesktopFilePath()); if( null == baPasscode ) @@ -398,6 +408,9 @@ namespace sscs.lss // rename existing file if(File.Exists(fileName)) { + if (File.Exists(fileName+".tmp")) + File.Delete(fileName+".tmp"); + File.Move(fileName, fileName+".tmp"); }