Skip to content

Commit fa8ba4f

Browse files
tomas-sexenianBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:CatchNullCount' into beta
1 parent 388d2f7 commit fa8ba4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,10 @@ public String getNextUID() throws GXMailException {
336336

337337
public int getMessageCount() throws GXMailException {
338338
try {
339+
if (emailFolder == null || !emailFolder.isOpen())
340+
throw new GXMailException("The email folder is either null or closed", MAIL_ServerRepliedErr);
339341
if (readSinceLast)
340342
return emailFolder.getNewMessageCount();
341-
342343
return emailFolder.getMessageCount();
343344
} catch (MessagingException e) {
344345
log(e.getMessage());

0 commit comments

Comments
 (0)