增加读取 AccountInfo 时的判断,优化方法效率

This commit is contained in:
QQQ
2024-05-17 15:34:20 +08:00
committed by eggmanQQQ
parent 3a6f414035
commit 9be7bbfe48

View File

@@ -52,7 +52,15 @@ static AccountInfoStorage *_instance = nil;
if (self.accountModel != nil) {
return self.accountModel;
}
if ([[NSFileManager defaultManager] fileExistsAtPath:[self getFilePath]] == NO) {
return nil;
}
NSData *data = [[NSData alloc] initWithContentsOfFile:[self getFilePath]];
if (data == nil) {
return nil;
}
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:data];
//