diff --git a/src/Serval/src/Serval.DataFiles/Controllers/CorporaController.cs b/src/Serval/src/Serval.DataFiles/Controllers/CorporaController.cs index 7e78ab2b..07c0c41a 100644 --- a/src/Serval/src/Serval.DataFiles/Controllers/CorporaController.cs +++ b/src/Serval/src/Serval.DataFiles/Controllers/CorporaController.cs @@ -157,6 +157,8 @@ private async Task AuthorizeAsync(string id, CancellationToken cancellationToken private async Task MapAsync(CorpusConfigDto corpusConfig, string id, CancellationToken cancellationToken) { + if (corpusConfig.Language == null || corpusConfig.Language.Length == 0) + throw new InvalidOperationException("Corpus must have a language."); return new Corpus { Id = id,