From e1b218b28b9a0cb9ed5032b4728696e493fa6444 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Thu, 9 Jan 2025 13:51:55 -0500 Subject: [PATCH] Fix #596 - corpus must have a language --- .../src/Serval.DataFiles/Controllers/CorporaController.cs | 2 ++ 1 file changed, 2 insertions(+) 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,