Skip to content

Commit d543c38

Browse files
committed
Preventing crash if attempting to close() an empty Shape2d
1 parent 1aef1dd commit d543c38

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cinder/Shape2d.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ void Shape2d::arcTo( const vec2 &p, const vec2 &t, float radius )
6363

6464
void Shape2d::close()
6565
{
66-
mContours.back().close();
66+
if( ! mContours.empty() )
67+
mContours.back().close();
6768
}
6869

6970
void Shape2d::append( const Shape2d &shape )

0 commit comments

Comments
 (0)