Skip to content

Commit e7ddfff

Browse files
committedAug 31, 2017
Fix some Coverity null pointer dereference warnings
1 parent 9a07cd5 commit e7ddfff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎src/gui/qgsattributeform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,7 @@ bool QgsAttributeForm::fieldIsEditable( int fieldIndex ) const
20372037
int srcFieldIndex;
20382038
const QgsVectorLayerJoinInfo *info = mLayer->joinBuffer()->joinForFieldIndex( fieldIndex, mLayer->fields(), srcFieldIndex );
20392039

2040-
if ( !info->hasUpsertOnEdit() && mMode == QgsAttributeForm::AddFeatureMode )
2040+
if ( info && !info->hasUpsertOnEdit() && mMode == QgsAttributeForm::AddFeatureMode )
20412041
editable = false;
20422042
else if ( info && info->isEditable() && info->joinLayer()->isEditable() )
20432043
editable = fieldIsEditable( *( info->joinLayer() ), srcFieldIndex, mFeature.id() );

‎src/providers/ogr/qgsgeopackagedataitems.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ bool QgsGeoPackageConnectionItem::handleDrop( const QMimeData *data, Qt::DropAct
383383
{
384384
if ( isVector ) // Import vectors and aspatial
385385
{
386-
QgsVectorLayer *vectorSrcLayer = dynamic_cast < QgsVectorLayer * >( srcLayer );
386+
QgsVectorLayer *vectorSrcLayer = qobject_cast < QgsVectorLayer * >( srcLayer );
387387
QVariantMap options;
388388
options.insert( QStringLiteral( "driverName" ), QStringLiteral( "GPKG" ) );
389389
options.insert( QStringLiteral( "update" ), true );

0 commit comments

Comments
 (0)
Please sign in to comment.