config service: return an empty config if no config is found
Returning an empty body breaks the client as it deserializes the response to null.
This commit is contained in:
@@ -36,6 +36,7 @@ import static com.mongodb.client.model.Updates.set;
|
|||||||
import static com.mongodb.client.model.Updates.unset;
|
import static com.mongodb.client.model.Updates.unset;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
@@ -114,7 +115,7 @@ public class ConfigService
|
|||||||
|
|
||||||
if (configMap == null || configMap.isEmpty())
|
if (configMap == null || configMap.isEmpty())
|
||||||
{
|
{
|
||||||
return null;
|
return new Configuration(Collections.emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ConfigEntry> config = new ArrayList<>();
|
List<ConfigEntry> config = new ArrayList<>();
|
||||||
|
|||||||
Reference in New Issue
Block a user