Fix issue with creating unnamed collections.

This commit is contained in:
Ottermandias 2024-06-01 20:28:43 +02:00
parent aba68cfb92
commit 5101b73fdc
2 changed files with 4 additions and 1 deletions

View file

@ -153,6 +153,9 @@ public class CollectionStorage : IReadOnlyList<ModCollection>, IDisposable
/// </summary>
public bool AddCollection(string name, ModCollection? duplicate)
{
if (name.Length == 0)
return false;
var newCollection = Create(name, _collections.Count, duplicate);
_collections.Add(newCollection);
_saveService.ImmediateSave(new ModCollectionSave(_modStorage, newCollection));