Skip to content

Commit c256d10

Browse files
committed
Fix some Coverity dereference null pointer warnings
1 parent 1f032aa commit c256d10

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/core/symbology-ng/qgsfillsymbollayerv2.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,7 @@ void QgsCentroidFillSymbolLayerV2::renderPolygon( const QPolygonF& points, QList
34553455
if ( context.geometryPartCount() > 1 )
34563456
{
34573457
const QgsGeometry *geom = feature->constGeometry();
3458-
const QgsGeometryCollectionV2* geomCollection = dynamic_cast<const QgsGeometryCollectionV2*>( geom->geometry() );
3458+
const QgsGeometryCollectionV2* geomCollection = static_cast<const QgsGeometryCollectionV2*>( geom->geometry() );
34593459

34603460
double area = 0;
34613461
double areaBiggest = 0;

src/gui/qgsattributeformeditorwidget.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void QgsAttributeFormEditorWidget::setMode( QgsAttributeFormEditorWidget::Mode m
6666

6767
void QgsAttributeFormEditorWidget::setIsMixed( bool mixed )
6868
{
69-
if ( mixed )
69+
if ( mWidget && mixed )
7070
mWidget->showIndeterminateState( );
7171
mMultiEditButton->setIsMixed( mixed );
7272
mIsMixed = mixed;
@@ -123,7 +123,8 @@ void QgsAttributeFormEditorWidget::resetValue()
123123
{
124124
mIsChanged = false;
125125
mBlockValueUpdate = true;
126-
mWidget->setValue( mPreviousValue );
126+
if ( mWidget )
127+
mWidget->setValue( mPreviousValue );
127128
mBlockValueUpdate = false;
128129

129130
switch ( mMode )

0 commit comments

Comments
 (0)