]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: add check to see if out is null
authorOrit Wasserman <owasserm@redhat.com>
Tue, 23 May 2017 15:45:00 +0000 (18:45 +0300)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 5 Jun 2017 20:18:01 +0000 (13:18 -0700)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
src/rgw/rgw_reshard.cc

index 7ef28f0fcd8d1a135f5deb4581ec9abaa93249df..1feaeb91708fd49bf9a6ff3c4b36c20aec7cdf29 100644 (file)
@@ -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;
   }