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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user