Skip to content

Commit

Permalink
[CSharp] Correction NPE composition sans domain
Browse files Browse the repository at this point in the history
  • Loading branch information
gideruette committed Sep 19, 2024
1 parent f7df4b8 commit b16bc83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TopModel.Generator.Csharp/DbContextGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected virtual void HandleMainFile(string fileName, string tag, string dbCont
w.WriteLine(2, $"modelBuilder.Entity<{fp.Class}>().Property(p => p.{fp.NamePascal}).HasConversion<{Config.GetImplementation(fp.Domain)?.Type ?? string.Empty}>(){(fp.Domain.Length != null ? $".HasMaxLength({fp.Domain.Length})" : string.Empty)};");
}

if (fp.Domain.Length != null && fp.Domain.Scale != null)
if (fp.Domain?.Length != null && fp.Domain?.Scale != null)
{
hasPropConfig = true;
w.WriteLine(2, $"modelBuilder.Entity<{fp.Class}>().Property(x => x.{fp.NamePascal}).HasPrecision({fp.Domain.Length}, {fp.Domain.Scale});");
Expand Down

0 comments on commit b16bc83

Please sign in to comment.