Merge pull request #99 from adityamandaleeka/no_samples_bug

Fix bug that occurs when there are no samples in a Linux trace
This commit is contained in:
Vance Morrison
2016-06-23 15:42:01 -07:00
committed by GitHub
@@ -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)