Skip to content

Commit a024639

Browse files
committed
fix crash from sarah sahioun
1 parent 00ab323 commit a024639

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

MetaMorpheus/TaskLayer/MetaMorpheusTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ public static IEnumerable<Ms2ScanWithSpecificMass> GetMs2Scans(MsDataFile myMSDa
425425
return new List<Ms2ScanWithSpecificMass>();
426426
}
427427

428-
var childScanNumbers = new HashSet<int>(scansWithPrecursors.SelectMany(p => p.SelectMany(v => v.ChildScans.Select(x => x.OneBasedScanNumber))));
429-
var parentScans = scansWithPrecursors.Where(p => p.Any() && !childScanNumbers.Contains(p.First().OneBasedScanNumber))
428+
var childScanNumbers = new HashSet<int>(scansWithPrecursors.Where(p => p != null).SelectMany(p => p.SelectMany(v => v.ChildScans.Select(x => x.OneBasedScanNumber))));
429+
var parentScans = scansWithPrecursors.Where(p => p != null && p.Count > 0 && !childScanNumbers.Contains(p.First().OneBasedScanNumber))
430430
.SelectMany(v => v)
431431
.OrderBy(p => p.OneBasedScanNumber)
432432
.ToArray();

0 commit comments

Comments
 (0)