summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceGrid/QueryI.cpp4
-rw-r--r--cpp/test/IceGrid/replicaGroup/AllTests.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/IceGrid/QueryI.cpp b/cpp/src/IceGrid/QueryI.cpp
index f2a7474c046..567857f2b4a 100644
--- a/cpp/src/IceGrid/QueryI.cpp
+++ b/cpp/src/IceGrid/QueryI.cpp
@@ -87,9 +87,9 @@ QueryI::findAllReplicas(const Ice::ObjectPrx& proxy, const Ice::Current&) const
try
{
AdapterInfoSeq infos = _database->getAdapterInfo(prx->ice_getAdapterId());
- assert(!infos.empty());
- if(infos[0].replicaGroupId != prx->ice_getAdapterId()) // The adapter id doesn't refer to a replica group.
+ if(infos.empty() || infos[0].replicaGroupId != prx->ice_getAdapterId())
{
+ // The adapter id doesn't refer to a replica group or the replica group is empty.
return Ice::ObjectProxySeq();
}
diff --git a/cpp/test/IceGrid/replicaGroup/AllTests.cpp b/cpp/test/IceGrid/replicaGroup/AllTests.cpp
index 28a0f612fdb..31f4d910a4e 100644
--- a/cpp/test/IceGrid/replicaGroup/AllTests.cpp
+++ b/cpp/test/IceGrid/replicaGroup/AllTests.cpp
@@ -213,6 +213,10 @@ allTests(const Ice::CommunicatorPtr& comm)
obj = TestIntfPrx::uncheckedCast(comm->stringToProxy("dummy:tcp"));
objs = query->findAllReplicas(obj);
test(objs.empty());
+
+ obj = TestIntfPrx::uncheckedCast(comm->stringToProxy("dummy@Ordered"));
+ objs = query->findAllReplicas(obj);
+ test(objs.empty());
removeServer(admin, "Server1");
removeServer(admin, "Server2");