From fec08eb5606ffb9833725ed0077d9baf2ee578bd Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Wed, 26 Aug 2015 12:38:49 +0100 Subject: [PATCH] Added a sanity check to the repair process --- Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs b/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs index b9d85e191..3d11406a8 100644 --- a/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs +++ b/Duplicati/Library/Main/Operation/RecreateDatabaseHandler.cs @@ -129,9 +129,15 @@ namespace Duplicati.Library.Main.Operation orderby n.Time descending select n; + if (filelists.Count() <= 0) + throw new Exception(string.Format("No filelists found on the remote destinatio")); + if (filelistfilter != null) filelists = filelistfilter(filelists).Select(x => x.Value).ToArray(); + if (filelists.Count() <= 0) + throw new Exception(string.Format("No filelists")); + // If we are updating, all files should be accounted for foreach(var fl in remotefiles) volumeIds[fl.File.Name] = updating ? restoredb.GetRemoteVolumeID(fl.File.Name) : restoredb.RegisterRemoteVolume(fl.File.Name, fl.FileType, fl.File.Size, RemoteVolumeState.Uploaded);