File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
src/common/commontypes/geometry Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export class LinearRing extends LineString {
4343 components = [ components ] ;
4444 }
4545 let len = components . length ;
46- if ( components [ 0 ] . equals ( components [ components . length - 1 ] ) ) {
46+ if ( len > 1 && components [ 0 ] . equals ( components [ components . length - 1 ] ) ) {
4747 len = components . length - 1 ;
4848 }
4949 for ( var i = 0 ; i < len ; i ++ ) {
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ describe('openlayers_Util', () => {
116116 var lineString = polygon . components [ 0 ] ;
117117 expect ( lineString instanceof LinearRing ) . toBeTruthy ( ) ;
118118 expect ( lineString . components ) . not . toBeNull ( ) ;
119- expect ( lineString . components . length ) . toBe ( 3 ) ;
119+ expect ( lineString . components . length ) . toBe ( 4 ) ;
120120 var point = lineString . components [ 0 ] ;
121121 expect ( point instanceof Point ) . toBeTruthy ( ) ;
122122 expect ( point . x ) . toBe ( - 2 ) ;
You can’t perform that action at this time.
0 commit comments