Commit 82897d99 authored by Florian Schmaus's avatar Florian Schmaus Committed by flow

OF-646 Made it clear that DateTime.parse() also may return null. Fixed muc/HistoryRequest.java

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13542 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9718a46e
......@@ -182,7 +182,7 @@ public class HistoryRequest {
try {
// Get the date when the historic message was sent
Date delayedDate = xmppDateTime.parseString(delayInformation.attributeValue("stamp"));
if (getSince() != null && delayedDate.before(getSince())) {
if (getSince() != null && delayedDate != null && delayedDate.before(getSince())) {
// Stop collecting history since we have exceded a limit
break;
}
......
......@@ -91,8 +91,11 @@ public class XMPPDateTimeFormat {
* XEP-0082: CCYY-MM-DDThh:mm:ss[.sss]TZD
* legacy: CCYYMMDDThh:mm:ss
*
* @param dateStr
* @return
* This method either returns a Date instance as result or it will return null or throw a ParseException
* in case the String couldn't be parsed.
*
* @param dateStr the String that should be parsed
* @return the parsed date or null if the String could not be parsed
* @throws ParseException
*/
public Date parseString(String dateString) throws ParseException {
......@@ -135,8 +138,11 @@ public class XMPPDateTimeFormat {
* Tries to convert a given string to a Date object.
* This method only supports the legacy XMPP time format: CCYYMMDDThh:mm:ss
*
* This method either returns a Date instance as result or it will return null or throw a ParseException
* in case the String couldn't be parsed.
*
* @param dateStr
* @return
* @return the parsed date or null if the String could not be parsed
* @throws ParseException
*/
public Date parseOldDate(String dateStr) throws ParseException {
......
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