From 3cd6f03b5857623220830ab983a2504630caafea Mon Sep 17 00:00:00 2001 From: "cao.leilc" Date: Mon, 19 Dec 2022 10:31:05 +0800 Subject: [PATCH] rgw: fix result when user's topics is null Fixes: https://tracker.ceph.com/issues/53370 Signed-off-by: caolei --- src/rgw/rgw_admin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index f18ce8cfbfb..dc9eeec9505 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -10430,7 +10430,7 @@ next: auto b = ps.get_bucket(bucket->get_key()); ret = b->get_topics(&result); - if (ret < 0) { + if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: could not get topics: " << cpp_strerror(-ret) << std::endl; return -ret; } @@ -10438,7 +10438,7 @@ next: } else { rgw_pubsub_topics result; int ret = ps.get_topics(&result); - if (ret < 0) { + if (ret < 0 && ret != -ENOENT) { cerr << "ERROR: could not get topics: " << cpp_strerror(-ret) << std::endl; return -ret; } -- 2.39.5