@@ -838,8 +838,8 @@ public static MimeMessage Reply (MimeMessage message, MailboxAddress from, bool
838
838
}
839
839
840
840
// set the reply subject
841
- if (! message .Subject .StartsWith (" Re:" , StringComparison .OrdinalIgnoreCase ))
842
- reply .Subject = " Re: " + message .Subject ;
841
+ if (! message .Subject ? .StartsWith (" Re:" , StringComparison .OrdinalIgnoreCase ))
842
+ reply .Subject = " Re: " + ( message .Subject ?? string . Empty ) ;
843
843
else
844
844
reply .Subject = message .Subject ;
845
845
@@ -964,8 +964,8 @@ public class ReplyVisitor : MimeVisitor
964
964
}
965
965
966
966
// set the reply subject
967
- if (! message .Subject .StartsWith (" Re:" , StringComparison .OrdinalIgnoreCase ))
968
- reply .Subject = " Re: " + message .Subject ;
967
+ if (! message .Subject ? .StartsWith (" Re:" , StringComparison .OrdinalIgnoreCase ))
968
+ reply .Subject = " Re: " + ( message .Subject ?? string . Empty ) ;
969
969
else
970
970
reply .Subject = message .Subject ;
971
971
@@ -1141,8 +1141,8 @@ public static MimeMessage Forward (MimeMessage original, MailboxAddress from, IE
1141
1141
message .To .AddRange (to );
1142
1142
1143
1143
// set the forwarded subject
1144
- if (! original .Subject .StartsWith (" FW:" , StringComparison .OrdinalIgnoreCase ))
1145
- message .Subject = " FW: " + original .Subject ;
1144
+ if (! original .Subject ? .StartsWith (" FW:" , StringComparison .OrdinalIgnoreCase ))
1145
+ message .Subject = " FW: " + ( original .Subject ?? string . Empty ) ;
1146
1146
else
1147
1147
message .Subject = original .Subject ;
1148
1148
@@ -1174,16 +1174,16 @@ public static MimeMessage Forward (MimeMessage original, MailboxAddress from, IE
1174
1174
message .To .AddRange (to );
1175
1175
1176
1176
// set the forwarded subject
1177
- if (! original .Subject .StartsWith (" FW:" , StringComparison .OrdinalIgnoreCase ))
1178
- message .Subject = " FW: " + original .Subject ;
1177
+ if (! original .Subject ? .StartsWith (" FW:" , StringComparison .OrdinalIgnoreCase ))
1178
+ message .Subject = " FW: " + ( original .Subject ?? string . Empty ) ;
1179
1179
else
1180
1180
message .Subject = original .Subject ;
1181
1181
1182
1182
// quote the original message text
1183
1183
using (var text = new StringWriter ()) {
1184
1184
text .WriteLine ();
1185
1185
text .WriteLine (" -------- Original Message --------" );
1186
- text .WriteLine (" Subject: {0}" , original .Subject );
1186
+ text .WriteLine (" Subject: {0}" , original .Subject ?? string . Empty );
1187
1187
text .WriteLine (" Date: {0}" , DateUtils .FormatDate (original .Date ));
1188
1188
text .WriteLine (" From: {0}" , original .From );
1189
1189
text .WriteLine (" To: {0}" , original .To );
0 commit comments