Skip to content

Commit 40f4f20

Browse files
committed
Coverity null deference fixes
1 parent ac6c324 commit 40f4f20

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

src/app/qgsmaptooladdcircularstring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void QgsMapToolAddCircularString::keyPressEvent( QKeyEvent* e )
7979

8080
void QgsMapToolAddCircularString::keyReleaseEvent( QKeyEvent* e )
8181
{
82-
if ( e->isAutoRepeat() )
82+
if ( e && e->isAutoRepeat() )
8383
{
8484
return;
8585
}

src/core/composer/qgsatlascomposition.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ QgsExpressionContext QgsAtlasComposition::createExpressionContext()
838838
expressionContext << new QgsExpressionContextScope( "Atlas" );
839839
if ( mCoverageLayer )
840840
expressionContext.lastScope()->setFields( mCoverageLayer->fields() );
841-
if ( mComposition->atlasMode() != QgsComposition::AtlasOff )
841+
if ( mComposition && mComposition->atlasMode() != QgsComposition::AtlasOff )
842842
expressionContext.lastScope()->setFeature( mCurrentFeature );
843843

844844
return expressionContext;

src/core/composer/qgscomposerattributetable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ bool QgsComposerAttributeTable::getFeatureAttributes( QList<QgsAttributeMap> &at
396396
if ( mComposerMap && mShowOnlyVisibleFeatures )
397397
{
398398
selectionRect = *mComposerMap->currentMapExtent();
399-
if ( mVectorLayer && mComposition->mapSettings().hasCrsTransformEnabled() )
399+
if ( mComposition->mapSettings().hasCrsTransformEnabled() )
400400
{
401401
//transform back to layer CRS
402402
QgsCoordinateTransform coordTransform( mVectorLayer->crs(), mComposition->mapSettings().destinationCrs() );

src/server/qgswmsserver.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2687,11 +2687,8 @@ void QgsWMSServer::applyOpacities( const QStringList& layerList, QList< QPair< Q
26872687
//modify symbols of current renderer
26882688
QgsRenderContext context;
26892689
context.expressionContext() << QgsExpressionContextUtils::globalScope()
2690-
<< QgsExpressionContextUtils::projectScope();
2691-
if ( vl )
2692-
{
2693-
context.expressionContext() << QgsExpressionContextUtils::layerScope( vl );
2694-
}
2690+
<< QgsExpressionContextUtils::projectScope()
2691+
<< QgsExpressionContextUtils::layerScope( vl );
26952692

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

0 commit comments

Comments
 (0)