From: Orit Wasserman Date: Tue, 23 May 2017 15:45:00 +0000 (+0300) Subject: rgw: add check to see if out is null X-Git-Tag: ses5-milestone6~8^2~7^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6c0611136db58effd76d1e8a559ae64c67f658b0;p=ceph.git rgw: add check to see if out is null Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index 7ef28f0fcd8d..1feaeb91708f 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; }