Skip to content

Commit

Permalink
handle case where lexeme might be null
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Apr 8, 2024
1 parent 42eebe7 commit 465aff9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/LfClassicData/Entities/Entry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace LfClassicData.Entities;
public class Entry: EntityDocument<Entry>
{
public Guid Guid { get; set; }
public required Dictionary<string, LexValue> Lexeme { get; set; }
public required Dictionary<string, LexValue>? Lexeme { get; set; }
public required Dictionary<string, LexValue> Note { get; set; }
public required Dictionary<string, LexValue> LiteralMeaning { get; set; }
public required Dictionary<string, LexValue>? CitationForm { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion backend/LfClassicData/LfClassicLexboxApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private async IAsyncEnumerable<Entry> Query(QueryOptions? options = null)
//todo, you can only sort by headword for now
.OrderBy(e => e.CitationForm?.TryGetValue(sortWs, out var val) == true
? val.Value
: e.Lexeme.TryGetValue(sortWs, out val)
: e.Lexeme?.TryGetValue(sortWs, out val) == true
? val.Value
: string.Empty)
.Skip(options.Offset)
Expand Down

0 comments on commit 465aff9

Please sign in to comment.