Skip to content

Commit

Permalink
Avoid crash
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 12, 2017
1 parent 4c136a7 commit f70b5b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/geometry/qgscurve.h
Expand Up @@ -145,8 +145,11 @@ class CORE_EXPORT QgsCurve: public QgsAbstractGeometry
*/
inline const QgsCurve *cast( const QgsAbstractGeometry *geom ) const
{
if ( !geom )
return nullptr;

QgsWkbTypes::Type type = geom->wkbType();
if ( geom && QgsWkbTypes::geometryType( type ) == QgsWkbTypes::LineGeometry && QgsWkbTypes::isSingleType( type ) )
if ( QgsWkbTypes::geometryType( type ) == QgsWkbTypes::LineGeometry && QgsWkbTypes::isSingleType( type ) )
{
return static_cast<const QgsCurve *>( geom );
}
Expand Down

0 comments on commit f70b5b5

Please sign in to comment.