Skip to content

Commit

Permalink
Fix some possible null pointer dereferences
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 30, 2015
1 parent e5fb5a6 commit cf7303f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/gui/symbology-ng/qgsrendererv2widget.cpp
Expand Up @@ -137,7 +137,8 @@ void QgsRendererV2Widget::changeSymbolWidth()
QList<QgsSymbolV2*>::iterator symbolIt = symbolList.begin();
for ( ; symbolIt != symbolList.end(); ++symbolIt )
{
dynamic_cast<QgsLineSymbolV2*>( *symbolIt )->setWidth( dlg.mSpinBox->value() );
if (( *symbolIt )->type() == QgsSymbolV2::Line )
static_cast<QgsLineSymbolV2*>( *symbolIt )->setWidth( dlg.mSpinBox->value() );
}
}
refreshSymbolView();
Expand All @@ -161,7 +162,8 @@ void QgsRendererV2Widget::changeSymbolSize()
QList<QgsSymbolV2*>::iterator symbolIt = symbolList.begin();
for ( ; symbolIt != symbolList.end(); ++symbolIt )
{
dynamic_cast<QgsMarkerSymbolV2*>( *symbolIt )->setSize( dlg.mSpinBox->value() );
if (( *symbolIt )->type() == QgsSymbolV2::Marker )
static_cast<QgsMarkerSymbolV2*>( *symbolIt )->setSize( dlg.mSpinBox->value() );
}
}
refreshSymbolView();
Expand All @@ -185,7 +187,8 @@ void QgsRendererV2Widget::changeSymbolAngle()
QList<QgsSymbolV2*>::iterator symbolIt = symbolList.begin();
for ( ; symbolIt != symbolList.end(); ++symbolIt )
{
dynamic_cast<QgsMarkerSymbolV2*>( *symbolIt )->setAngle( dlg.mSpinBox->value() );
if (( *symbolIt )->type() == QgsSymbolV2::Marker )
static_cast<QgsMarkerSymbolV2*>( *symbolIt )->setAngle( dlg.mSpinBox->value() );
}
}
refreshSymbolView();
Expand Down

0 comments on commit cf7303f

Please sign in to comment.