From 6c0611136db58effd76d1e8a559ae64c67f658b0 Mon Sep 17 00:00:00 2001 From: Orit Wasserman Date: Tue, 23 May 2017 18:45:00 +0300 Subject: [PATCH] rgw: add check to see if out is null Signed-off-by: Orit Wasserman --- src/rgw/rgw_reshard.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index 7ef28f0fcd8d1..1feaeb91708fd 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -445,8 +445,10 @@ int RGWBucketReshard::do_reshard( } if (verbose) { formatter->close_section(); - formatter->flush(*out); - formatter->flush(*out); + if (out) { + formatter->flush(*out); + formatter->flush(*out); + } } else if (out && !(total_entries % 1000)) { (*out) << " " << total_entries; } @@ -455,7 +457,9 @@ int RGWBucketReshard::do_reshard( } if (verbose) { formatter->close_section(); - formatter->flush(*out); + if (out) { + formatter->flush(*out); + } } else if (out) { (*out) << " " << total_entries << std::endl; } -- 2.39.5