Skip to content

Commit da09406

Browse files
committed
fix error for empty file import list
1 parent 4d75e64 commit da09406

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

Assemblies/ModSwitch.dll

0 Bytes
Binary file not shown.

Source/ModSwitch/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
[assembly: System.Reflection.AssemblyCopyright("Copyright © DoctorVanGogh 2017")]
1313
[assembly: System.Runtime.InteropServices.ComVisible(false)]
1414
[assembly: System.Runtime.InteropServices.Guid("ab2e8e89-3d1d-4e36-a0ae-489b6ebc84a6")]
15-
[assembly: System.Reflection.AssemblyVersion("1.7.0.216")]
15+
[assembly: System.Reflection.AssemblyVersion("1.7.0.218")]
1616

1717

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7.0.216
1+
1.7.0.218

Source/ModSwitch/Settings.cs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,21 +118,23 @@ public void DoWindowContents(Rect rect) {
118118
new List<FloatMenuOption> {
119119
new FloatMenuOption(
120120
LanguageKeys.keyed.ModSwitch_Import_FromFile.Translate(),
121-
() => Find.WindowStack.Add(
122-
new FloatMenu(
123-
MS_GenFilePaths.AllExports
124-
.Select(
125-
fi => new FloatMenuOption(
126-
fi.Name,
127-
() => {
128-
try {
129-
ImportFromExport(fi);
130-
} catch (Exception e) {
131-
Util.DisplayError(e);
132-
}
133-
}))
134-
.ToList())
135-
)),
121+
() => {
122+
var options = MS_GenFilePaths.AllExports
123+
.Select(
124+
fi => new FloatMenuOption(
125+
fi.Name,
126+
() => {
127+
try {
128+
ImportFromExport(fi);
129+
} catch (Exception e) {
130+
Util.DisplayError(e);
131+
}
132+
}))
133+
.ToList();
134+
135+
if (options.Count != 0)
136+
Find.WindowStack.Add(new FloatMenu(options));
137+
}),
136138
new FloatMenuOption(
137139
LanguageKeys.keyed.ModSwitch_Import_Savegame.Translate(),
138140
() => Find.WindowStack.Add(

0 commit comments

Comments
 (0)