CachingOmemoStore: check for nullity of wrapped store

This commit is contained in:
Paul Schaub 2018-01-09 15:27:49 +01:00
parent f3403571a7
commit 28cabf00ee
2 changed files with 4 additions and 1 deletions

View File

@ -45,7 +45,7 @@ public class SignalCachingOmemoStore extends CachingOmemoStore<IdentityKeyPair,
/**
* Create a new SignalCachingOmemoStore as a caching layer around a persisting OmemoStore
* (eg. a SignalFileBasedOmemoStore).
* @param wrappedStore
* @param wrappedStore other store implementation that gets wrapped
*/
public SignalCachingOmemoStore(OmemoStore<IdentityKeyPair, IdentityKey, PreKeyRecord, SignedPreKeyRecord,
SessionRecord, SignalProtocolAddress, ECPublicKey, PreKeyBundle, SessionCipher> wrappedStore)

View File

@ -63,6 +63,9 @@ public class CachingOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Se
}
public CachingOmemoStore(OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> wrappedStore) {
if (wrappedStore == null) {
throw new NullPointerException("Wrapped OmemoStore MUST NOT be null!");
}
this.keyUtil = null;
persistent = wrappedStore;
}