diff --git a/Helpers/BackupFolders.cs b/Helpers/BackupFolders.cs
index 59331f5..02563e5 100644
--- a/Helpers/BackupFolders.cs
+++ b/Helpers/BackupFolders.cs
@@ -53,16 +53,17 @@ private static string GetTargetBackupFolder(string profileName, DateTime lastCha
public static int MakeBackup(this GameProfile profile, DateTime x)
{
string targetPath = GetTargetBackupFolder(profile.BackupFolder, x);
+ string savesFolder = profile.GetSavesFolder();
if (string.IsNullOrEmpty(profile.BackupFilter))
{
- CopyFolder(profile.GetSavesFolder(), targetPath);
+ CopyFolder(savesFolder, targetPath);
return -1;
}
int counter = 0;
- foreach (string path in ApplyFilter(profile.GetSavesFolder(), profile.BackupFilter))
+ foreach (string path in ApplyFilter(savesFolder, profile.BackupFilter))
{
- string target = path.Replace(profile.GetSavesFolder(), targetPath);
+ string target = path.Replace(savesFolder, targetPath);
Directory.CreateDirectory(Path.GetDirectoryName(target)!);
File.Copy(path, target, true);
counter++;
diff --git a/Memento.csproj b/Memento.csproj
index 10c60b0..9876579 100644
--- a/Memento.csproj
+++ b/Memento.csproj
@@ -4,7 +4,7 @@
WinExe
net8.0-windows7.0
true
- 1.6.1
+ 1.6.2
Resources\Main.ico
Memento
Memento
diff --git a/Models/GameProfile.cs b/Models/GameProfile.cs
index 1ee9d62..a881f0e 100644
--- a/Models/GameProfile.cs
+++ b/Models/GameProfile.cs
@@ -79,6 +79,12 @@ private static string Replace(string source, string search, string replace)
private string DetectPath(Dictionary pathCollection, Dictionary>> prefixMap)
{
+ if (prefixMap == null)
+ {
+ Log($"Cannot detect path for {ProfileName} on {Environment.MachineName} because prefix map is not specified");
+ return null;
+ }
+
Log($"Detecting path for {ProfileName} on {Environment.MachineName}");
if (!prefixMap.TryGetValue(Environment.MachineName, out Dictionary> localPrefixes))
@@ -173,20 +179,6 @@ string UseFirstPrefix()
return null;
}
- //private static readonly Dictionary>> PrefixMap = new()
- //{
- // ["IREALM2022"]= new()
- // {
- // ["UserProfilePrefix"] = [@"C:\Users\andrewsav\"],
- // ["SteamPathPrefix"] = [@"D:\steam\", @"C:\steam\"]
- // },
- // ["13960-ASAV"] = new()
- // {
- // ["UserProfilePrefix"] = [@"C:\Users\admas$\"],
- // ["SteamPathPrefix"] = [@"D:\Misc\steam\"]
- // }
- //};
-
public string GetSavesFolder()
{
diff --git a/README.md b/README.md
index c51954d..009a08a 100644
--- a/README.md
+++ b/README.md
@@ -126,6 +126,9 @@ To create a release via GitHub actions update version in `Memento.csproj`and cre
## Change Log
+* 1.6.2
+ * Fixed crash if path detection would run, but no prefix map was specified
+ * Resolved slow downs with path detections on certain code paths
* 1.6.1
* GitHub Actions build process
* 1.6.0