Skip to content

Commit

Permalink
Coverity null dereference fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 4, 2015
1 parent c3b0271 commit ae0d377
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,14 +862,14 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
//color
QColor pc = mPen.color();
QColor bc = mBrush.color();
if ( hasDataDefinedProperty( QgsSymbolLayerV2::EXPR_COLOR ) )
if ( context && hasDataDefinedProperty( QgsSymbolLayerV2::EXPR_COLOR ) )
{
context->setOriginalValueVariable( QgsSymbolLayerV2Utils::encodeColor( bc ) );
QString colorString = evaluateDataDefinedProperty( QgsSymbolLayerV2::EXPR_COLOR, *context, QVariant(), &ok ).toString();
if ( ok )
bc = QgsSymbolLayerV2Utils::decodeColor( colorString );
}
if ( hasDataDefinedProperty( QgsSymbolLayerV2::EXPR_COLOR_BORDER ) )
if ( context && hasDataDefinedProperty( QgsSymbolLayerV2::EXPR_COLOR_BORDER ) )
{
context->setOriginalValueVariable( QgsSymbolLayerV2Utils::encodeColor( pc ) );
QString colorString = evaluateDataDefinedProperty( QgsSymbolLayerV2::EXPR_COLOR_BORDER, *context, QVariant(), &ok ).toString();
Expand All @@ -895,7 +895,7 @@ bool QgsSimpleMarkerSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitSc
}

QString name( mName );
if ( hasDataDefinedProperty( QgsSymbolLayerV2::EXPR_NAME ) )
if ( context && hasDataDefinedProperty( QgsSymbolLayerV2::EXPR_NAME ) )
{
context->setOriginalValueVariable( mName );
name = evaluateDataDefinedProperty( QgsSymbolLayerV2::EXPR_NAME, *context, QVariant(), &ok ).toString();
Expand Down

0 comments on commit ae0d377

Please sign in to comment.