Skip to content

Commit b4a16d5

Browse files
Avoid null pointer exception crashing the webapp.
Issue:203914
1 parent fd7586c commit b4a16d5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

gxmail/src/main/java/com/genexus/internet/SMTPSessionJavaMail.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import jakarta.mail.internet.MimeBodyPart;
1515
import jakarta.activation.*;
16+
import org.apache.commons.lang3.ObjectUtils;
1617

1718
public final class SMTPSessionJavaMail implements GXInternetConstants,ISMTPSession
1819
{
@@ -239,6 +240,11 @@ public void logout(GXSMTPSession sessionInfo)
239240
log ("7 - IOException " + e.getMessage());
240241
sessionInfo.exceptionHandler(new GXMailException(e.getMessage(), MAIL_ConnectionLost));
241242
}
243+
catch (NullPointerException e)
244+
{
245+
log ("8 - NullPointerException " + e.getMessage());
246+
sessionInfo.exceptionHandler(new GXMailException(e.getMessage(), MAIL_ConnectionLost));
247+
}
242248
}
243249

244250
public void setSubject(String subject)

0 commit comments

Comments
 (0)