File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,10 @@ public IEnumerable<GuidancePattern> ImportGuidancePatterns(IEnumerable<ISOGuidan
215215 foreach ( ISOGuidancePattern isoGuidancePattern in isoGuidancePatterns )
216216 {
217217 GuidancePattern adaptGuidancePattern = ImportGuidancePattern ( isoGuidancePattern ) ;
218- adaptGuidancePatterns . Add ( adaptGuidancePattern ) ;
218+ if ( adaptGuidancePattern != null )
219+ {
220+ adaptGuidancePatterns . Add ( adaptGuidancePattern ) ;
221+ }
219222 }
220223
221224 //Add the patterns to the Catalog
@@ -236,7 +239,13 @@ public GuidancePattern ImportGuidancePattern(ISOGuidancePattern isoGuidancePatte
236239 GuidancePattern pattern = null ;
237240 LineStringMapper lineStringMapper = new LineStringMapper ( TaskDataMapper ) ;
238241 PointMapper pointMapper = new PointMapper ( TaskDataMapper ) ;
239- var isoLineString = isoGuidancePattern . LineString ?? new ISOLineString ( ) ;
242+ ISOLineString isoLineString = isoGuidancePattern . LineString ;
243+ if ( ( isoLineString ? . Points ? . Count ?? 0 ) == 0 )
244+ {
245+ TaskDataMapper . AddError ( $ "Guidance pattern { isoGuidancePattern . GuidancePatternDesignator } is invalid. Skipping.") ;
246+ return null ;
247+ }
248+
240249 switch ( isoGuidancePattern . GuidancePatternType )
241250 {
242251 case ISOGuidancePatternType . AB :
You can’t perform that action at this time.
0 commit comments