mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-06 04:05:59 +01:00
Fix NPE
This commit is contained in:
parent
c287345ce7
commit
9c7a027b62
1 changed files with 8 additions and 0 deletions
|
@ -384,6 +384,10 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
||||||
if (OmemoConfiguration.getIgnoreStaleDevices()) {
|
if (OmemoConfiguration.getIgnoreStaleDevices()) {
|
||||||
|
|
||||||
Date lastActivity = getOmemoStoreBackend().getDateOfLastReceivedMessage(userDevice, contactsDevice);
|
Date lastActivity = getOmemoStoreBackend().getDateOfLastReceivedMessage(userDevice, contactsDevice);
|
||||||
|
if (lastActivity == null) {
|
||||||
|
lastActivity = new Date();
|
||||||
|
getOmemoStoreBackend().setDateOfLastReceivedMessage(userDevice, contactsDevice, lastActivity);
|
||||||
|
}
|
||||||
|
|
||||||
if (isStale(userDevice, contactsDevice, lastActivity, OmemoConfiguration.getIgnoreStaleDevicesAfterHours())) {
|
if (isStale(userDevice, contactsDevice, lastActivity, OmemoConfiguration.getIgnoreStaleDevicesAfterHours())) {
|
||||||
LOGGER.log(Level.FINE, "Device " + contactsDevice + " seems to be stale (last message received "
|
LOGGER.log(Level.FINE, "Device " + contactsDevice + " seems to be stale (last message received "
|
||||||
|
@ -1038,6 +1042,10 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lastReceipt == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
long maxAgeMillis = MILLIS_PER_HOUR * maxAgeHours;
|
long maxAgeMillis = MILLIS_PER_HOUR * maxAgeHours;
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue