Fix bug that occurs when there are no samples in a Linux trace.

This commit is contained in:
Aditya Mandaleeka
2016-06-23 15:22:55 -07:00
parent 027589f0e5
commit 77b2c8fece
@@ -301,6 +301,11 @@ namespace Diagnostics.Tracing.StackSources
{
Contract.Requires(_samples != null, nameof(_samples));
if (!_samples.Any())
{
return;
}
List<StackSourceSample> samples = _samples.ToList();
samples.Sort((x, y) => x.TimeRelativeMSec.CompareTo(y.TimeRelativeMSec));
double startTime = samples[0].TimeRelativeMSec;
@@ -396,7 +401,7 @@ namespace Diagnostics.Tracing.StackSources
archive = null;
if (path.EndsWith(".zip"))
{
archive = ZipFile.OpenRead(path);
archive = ZipFile.OpenRead(path);
ZipArchiveEntry foundEntry = null;
foreach (ZipArchiveEntry entry in archive.Entries)