Commit a8a2fe2d authored by 潘栩锋's avatar 潘栩锋 🚴

修复 当数据库一个数据都没有 BackupBbInSize 会出错

parent e418ef69
...@@ -303,7 +303,8 @@ namespace SQLite ...@@ -303,7 +303,8 @@ namespace SQLite
var firstTime = (DateTime)ret; var firstTime = (DateTime)ret;
firstTimes.Add(firstTime); firstTimes.Add(firstTime);
} }
if (firstTimes.Count() == 0)
return;//no datas
DateTime curr_month = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); DateTime curr_month = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
int curr_total_month = curr_month.Year * 12 + curr_month.Month; int curr_total_month = curr_month.Year * 12 + curr_month.Month;
...@@ -451,7 +452,8 @@ namespace SQLite ...@@ -451,7 +452,8 @@ namespace SQLite
Regex regex = new Regex(@"\A(\d\d\d\d)-(\d\d)\z"); Regex regex = new Regex(@"\A(\d\d\d\d)-(\d\d)\z");
var dirInfo = new DirectoryInfo(Path.GetDirectoryName(DBPath)); var dirInfo = new DirectoryInfo(Path.GetDirectoryName(DBPath));
var dirInfos = dirInfo.GetDirectories(); var dirInfos = dirInfo.GetDirectories();
if (dirInfos == null || dirInfos.Count() == 0)
return;//什么都没有
foreach (var dinfo in dirInfos) { foreach (var dinfo in dirInfos) {
var match = regex.Match(dinfo.Name); var match = regex.Match(dinfo.Name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment