Disable ContactStore when contactstore.url is empty

This allows a config to disable ContactStore even when a URL is provided
in its fallback config.

Change-Id: I02d0e47ae0287ccc85387db743d52e058db21096
This commit is contained in:
Dave Borowitz
2012-01-05 15:47:38 -08:00
parent 5358db4b26
commit 2bb2a28dc6

View File

@@ -25,6 +25,7 @@ import com.google.inject.ProvisionException;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.util.StringUtils;
import java.io.File;
import java.lang.reflect.Constructor;
@@ -53,7 +54,7 @@ public class ContactStoreProvider implements Provider<ContactStore> {
@Override
public ContactStore get() {
final String url = config.getString("contactstore", null, "url");
if (url == null) {
if (StringUtils.isEmptyOrNull(url)) {
return new NoContactStore();
}