Skip to content

Commit

Permalink
Fix some Coverity dereference null pointer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 1, 2016
1 parent 1f032aa commit c256d10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/symbology-ng/qgsfillsymbollayerv2.cpp
Expand Up @@ -3455,7 +3455,7 @@ void QgsCentroidFillSymbolLayerV2::renderPolygon( const QPolygonF& points, QList
if ( context.geometryPartCount() > 1 )
{
const QgsGeometry *geom = feature->constGeometry();
const QgsGeometryCollectionV2* geomCollection = dynamic_cast<const QgsGeometryCollectionV2*>( geom->geometry() );
const QgsGeometryCollectionV2* geomCollection = static_cast<const QgsGeometryCollectionV2*>( geom->geometry() );

double area = 0;
double areaBiggest = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/gui/qgsattributeformeditorwidget.cpp
Expand Up @@ -66,7 +66,7 @@ void QgsAttributeFormEditorWidget::setMode( QgsAttributeFormEditorWidget::Mode m

void QgsAttributeFormEditorWidget::setIsMixed( bool mixed )
{
if ( mixed )
if ( mWidget && mixed )
mWidget->showIndeterminateState( );
mMultiEditButton->setIsMixed( mixed );
mIsMixed = mixed;
Expand Down Expand Up @@ -123,7 +123,8 @@ void QgsAttributeFormEditorWidget::resetValue()
{
mIsChanged = false;
mBlockValueUpdate = true;
mWidget->setValue( mPreviousValue );
if ( mWidget )
mWidget->setValue( mPreviousValue );
mBlockValueUpdate = false;

switch ( mMode )
Expand Down

0 comments on commit c256d10

Please sign in to comment.