Issue 678: Unhandled error when importing peak boundaries for document with no result files

Status:open
Assigned To:Nick Shulman
Type:Defect
Area:Skyline
Priority:4
Milestone: 
Opened:2019-08-30 by philip remes
Changed:2019-08-30 by Brendan MacLean
Resolved:
Resolution:
Closed:
2019-08-30 philip remes
Title»Unhandled error when importing peak boundaries for document with no result files
Assigned ToGuest»Brendan MacLean
Type»Defect
Area»Skyline
Priority»3
Open a blank skyline document, and import peak boundaries with the attached file. An error dialog pops up with the ol' "object reference is not set to an instance of an object". Probably there's an array that didn't get initialized if there were no results. If there are results, even ones that aren't in the peak boundaries file names, then the error is handled properly. If the correct result files are there, then all the boundaries are imported and applied correctly.

Best regards,
Phil

System.Reflection.TargetInvocationException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at pwiz.Skyline.Model.PeakBoundaryImporter.GetMaxRt(SrmDocument document) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Model\ImportPeakBoundaries.cs:line 187
   at pwiz.Skyline.Model.PeakBoundaryImporter.IsMinutesPeakBoundaries(TextReader reader) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Model\ImportPeakBoundaries.cs:line 181
   at pwiz.Skyline.Model.PeakBoundaryImporter.Import(String inputFile, IProgressMonitor progressMonitor, Int64 lineCount, Boolean removeMissing, Boolean changePeaks) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Model\ImportPeakBoundaries.cs:line 147
   at pwiz.Skyline.SkylineWindow.<>c__DisplayClass997_0.<ImportPeakBoundaries>b__2(IProgressMonitor longWaitBroker) in C:\proj\pwiz_x64\pwiz_tools\Skyline\SkylineFiles.cs:line 1487
   at pwiz.Skyline.Util.ProgressWaitBroker.PerformWork(ILongWaitBroker broker) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Util\UtilUI.cs:line 123
   at pwiz.Skyline.Controls.LongWaitDlg.RunWork(Action`1 performWork) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Controls\LongWaitDlg.cs:line 232
   --- End of inner exception stack trace ---
   at pwiz.Skyline.Util.Helpers.WrapAndThrowException(Exception x) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Util\Util.cs:line 1868
   at pwiz.Skyline.Controls.LongWaitDlg.PerformWork(Control parent, Int32 delayMillis, Action`1 performWork) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Controls\LongWaitDlg.cs:line 180
   at pwiz.Skyline.Controls.LongWaitDlg.PerformWork(Control parent, Int32 delayMillis, Action`1 performWork) in C:\proj\pwiz_x64\pwiz_tools\Skyline\Controls\LongWaitDlg.cs:line 132
   at pwiz.Skyline.SkylineWindow.ImportPeakBoundaries(String fileName, Int64 lineCount, String description) in C:\proj\pwiz_x64\pwiz_tools\Skyline\SkylineFiles.cs:line 1486
   at pwiz.Skyline.SkylineWindow.ImportPeakBoundariesFile(String peakBoundariesFile) in C:\proj\pwiz_x64\pwiz_tools\Skyline\SkylineFiles.cs:line 1462
 
 190830_peak_boundaries_blanks.csv

2019-08-30 Brendan MacLean
Assigned ToBrendan MacLean»Nick Shulman
Priority3»4
Yeah. We should block that code path by showing a normal error message that importing peak boundaries requires imported results. And we should double-check that we don't need more protection around the failing code even when there are imported results.

But, it's a pretty low priority since it can easily be avoided.