From 8b195eccadbd4d48518e33e08670b25527c3ca23 Mon Sep 17 00:00:00 2001 From: VRan Liu Date: Mon, 24 Nov 2014 10:35:41 +0800 Subject: [PATCH] check endpoints is not empty before use it. Signed-off-by: VRan Liu (cherry picked from commit 9d5e4edc15678de675d7a77badcbace0b710d553) --- src/rgw/rgw_op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 04de5a2954ebb..4100d408675dd 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -373,7 +373,7 @@ static int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bu string& region = s->bucket_info.region; map::iterator dest_region = store->region_map.regions.find(region); - if (dest_region != store->region_map.regions.end()) { + if (dest_region != store->region_map.regions.end() && !dest_region->second.endpoints.empty()) { s->region_endpoint = dest_region->second.endpoints.front(); } if (s->bucket_exists && !store->region.equals(region)) { -- 2.39.5