Check optional value in keyring getter, hint nullable

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-10 14:49:01 +02:00
parent ab4491d956
commit 7351363830

View File

@ -776,8 +776,9 @@ public class P2PService implements SetupListener, MessageListener, ConnectionLis
}
@VisibleForTesting
@Nullable
public KeyRing getKeyRing() {
return optionalKeyRing.get();
return optionalKeyRing.isPresent()? optionalKeyRing.get() : null;
}
///////////////////////////////////////////////////////////////////////////////////////////