susimail: Fix NPE when deleting last message (ticket #414)

This commit is contained in:
str4d
2013-11-23 04:24:30 +00:00
parent 57144f3e6a
commit 0dde4162e6
2 changed files with 12 additions and 4 deletions

View File

@ -1287,10 +1287,15 @@ public class WebMail extends HttpServlet
if( sessionObject.state == STATE_SHOW ) {
processMessageButtons( sessionObject, request );
Mail mail = sessionObject.mailCache.getMail( sessionObject.showUIDL, MailCache.FETCH_ALL );
if( mail != null && mail.error.length() > 0 ) {
sessionObject.error += mail.error;
mail.error = "";
// If the last message has just been deleted then
// sessionObject.state = STATE_LIST and
// sessionObject.showUIDL = null
if ( sessionObject.showUIDL != null ) {
Mail mail = sessionObject.mailCache.getMail( sessionObject.showUIDL, MailCache.FETCH_ALL );
if( mail != null && mail.error.length() > 0 ) {
sessionObject.error += mail.error;
mail.error = "";
}
}
}

View File

@ -1,3 +1,6 @@
2013-11-23 str4d
* susimail: Fix NPE when deleting last message (ticket #414)
2013-11-19 kytv
* Translation updates and start of Japanese translation pulled from Transifex