Better handle .miCASA persistent file
This commit is contained in:
parent
51ed454f9c
commit
92075e8aff
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user