Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Coverity null deference fixes
  • Loading branch information
nyalldawson committed Aug 28, 2015
1 parent ac6c324 commit 40f4f20
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app/qgsmaptooladdcircularstring.cpp
Expand Up @@ -79,7 +79,7 @@ void QgsMapToolAddCircularString::keyPressEvent( QKeyEvent* e )

void QgsMapToolAddCircularString::keyReleaseEvent( QKeyEvent* e )
{
if ( e->isAutoRepeat() )
if ( e && e->isAutoRepeat() )
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgsatlascomposition.cpp
Expand Up @@ -838,7 +838,7 @@ QgsExpressionContext QgsAtlasComposition::createExpressionContext()
expressionContext << new QgsExpressionContextScope( "Atlas" );
if ( mCoverageLayer )
expressionContext.lastScope()->setFields( mCoverageLayer->fields() );
if ( mComposition->atlasMode() != QgsComposition::AtlasOff )
if ( mComposition && mComposition->atlasMode() != QgsComposition::AtlasOff )
expressionContext.lastScope()->setFeature( mCurrentFeature );

return expressionContext;
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposerattributetable.cpp
Expand Up @@ -396,7 +396,7 @@ bool QgsComposerAttributeTable::getFeatureAttributes( QList<QgsAttributeMap> &at
if ( mComposerMap && mShowOnlyVisibleFeatures )
{
selectionRect = *mComposerMap->currentMapExtent();
if ( mVectorLayer && mComposition->mapSettings().hasCrsTransformEnabled() )
if ( mComposition->mapSettings().hasCrsTransformEnabled() )
{
//transform back to layer CRS
QgsCoordinateTransform coordTransform( mVectorLayer->crs(), mComposition->mapSettings().destinationCrs() );
Expand Down
7 changes: 2 additions & 5 deletions src/server/qgswmsserver.cpp
Expand Up @@ -2687,11 +2687,8 @@ void QgsWMSServer::applyOpacities( const QStringList& layerList, QList< QPair< Q
//modify symbols of current renderer
QgsRenderContext context;
context.expressionContext() << QgsExpressionContextUtils::globalScope()
<< QgsExpressionContextUtils::projectScope();
if ( vl )
{
context.expressionContext() << QgsExpressionContextUtils::layerScope( vl );
}
<< QgsExpressionContextUtils::projectScope()
<< QgsExpressionContextUtils::layerScope( vl );

QgsSymbolV2List symbolList = rendererV2->symbols( context );
QgsSymbolV2List::iterator symbolIt = symbolList.begin();
Expand Down

0 comments on commit 40f4f20

Please sign in to comment.