Bug 1353349 - Don't attempt to put empty profiles into the processes array. r?froydnj draft
authorMarkus Stange <mstange@themasta.com>
Tue, 09 May 2017 15:40:50 -0400
changeset 575068 a2f62b7ad0f03e00a051a498d348bdada5e441aa
parent 575065 04d7e8e578c05e7ed6abcbb995ce8aec003235b4
child 627795 b7a8d19eeddfb146eeeed993fcfce9c3a1930323
push id57925
push userbmo:mstange@themasta.com
push dateTue, 09 May 2017 19:41:07 +0000
reviewersfroydnj
bugs1353349
milestone55.0a1
Bug 1353349 - Don't attempt to put empty profiles into the processes array. r?froydnj MozReview-Commit-ID: HFjLEaqippx
tools/profiler/gecko/ProfileGatherer.cpp
--- a/tools/profiler/gecko/ProfileGatherer.cpp
+++ b/tools/profiler/gecko/ProfileGatherer.cpp
@@ -42,17 +42,19 @@ ProfileGatherer::GatheredOOPProfile(cons
     // If we're not actively gathering, then we don't actually
     // care that we gathered a profile here. This can happen for
     // processes that exit while profiling.
     return;
   }
 
   MOZ_RELEASE_ASSERT(mWriter.isSome(), "Should always have a writer if mGathering is true");
 
-  mWriter->Splice(PromiseFlatCString(aProfile).get());
+  if (!aProfile.IsEmpty()) {
+    mWriter->Splice(PromiseFlatCString(aProfile).get());
+  }
 
   mPendingProfiles--;
 
   if (mPendingProfiles == 0) {
     // We've got all of the async profiles now. Let's
     // finish off the profile and resolve the Promise.
     Finish();
   }