Fix getting new translator id for first translator.

This commit is contained in:
2019-05-24 00:27:29 +01:00
parent 1beccca33e
commit f32bace3c6

View File

@@ -53,7 +53,7 @@ namespace Claunia.Localization.Core
/// <returns>The new translator</returns>
public Translator NewTranslator(string name, string email, string nativeName = null)
{
int id = translators.Max(t => t.Id) + 1;
int id = translators.Count > 0 ? translators.Max(t => t.Id) + 1 : 1;
Translator translator = new Translator(id) {Name = name, Email = email};
translator.Modified += OnModified;