Commit c3b56051 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed bug calculating length of messages with no body.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@702 b35dd754-fafc-0310-a699-88a17e54d16e
parent d89c88e8
...@@ -151,7 +151,8 @@ public class HistoryRequest { ...@@ -151,7 +151,8 @@ public class HistoryRequest {
while (iterator.hasPrevious()) { while (iterator.hasPrevious()) {
message = (Message)iterator.previous(); message = (Message)iterator.previous();
// Update number of characters to send // Update number of characters to send
accumulatedChars += message.getBody().length(); String text = message.getBody() == null ? message.getSubject() : message.getBody();
accumulatedChars += text.length();
if (getMaxChars() > -1 && accumulatedChars > getMaxChars()) { if (getMaxChars() > -1 && accumulatedChars > getMaxChars()) {
// Stop collecting history since we have exceded a limit // Stop collecting history since we have exceded a limit
break; break;
...@@ -181,7 +182,7 @@ public class HistoryRequest { ...@@ -181,7 +182,7 @@ public class HistoryRequest {
} }
} }
} }
catch (ParseException e) { catch (Exception e) {
Log.error("Error parsing date from historic message", e); Log.error("Error parsing date from historic message", e);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment