Skip to content

Commit daa1fdd

Browse files
committed
Fix Email API Null Error
1 parent 3a4dcad commit daa1fdd

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

EmailService-API/Models/EmailServiceContext.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,19 @@ public int EnqueueIncomingMessagesRun(string userName, string title, string? Cre
6363
{
6464
try
6565
{
66-
// Use SELECT to execute the PostgreSQL function with proper parameter binding
66+
// Use SELECT to execute the PostgreSQL function with proper null handling
6767
var result = this.Database.ExecuteSqlRaw(
6868
"SELECT dbo.enqueueincomingmessages({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9})",
69-
userName,
70-
title,
71-
(object?)CreatedEmail ?? DBNull.Value,
72-
(object?)CreatedName ?? DBNull.Value,
73-
(object?)isSecure ?? DBNull.Value,
74-
bodyHtml,
75-
(object?)messageType ?? DBNull.Value,
76-
(object?)isImportantTag ?? DBNull.Value,
77-
(object?)ccEmail ?? DBNull.Value,
78-
(object?)bccEmail ?? DBNull.Value
69+
userName ?? (object)"",
70+
title ?? (object)"",
71+
CreatedEmail ?? (object)"",
72+
CreatedName ?? (object)"",
73+
isSecure.HasValue ? (object)isSecure.Value : (object)false,
74+
bodyHtml ?? (object)"",
75+
messageType ?? (object)"",
76+
isImportantTag.HasValue ? (object)isImportantTag.Value : (object)false,
77+
ccEmail ?? (object)"",
78+
bccEmail ?? (object)""
7979
);
8080
return 1;
8181
}

0 commit comments

Comments
 (0)