Skip to content
Permalink
Browse files
Fix some Coverity null pointer dereference warnings
  • Loading branch information
nyalldawson committed Aug 31, 2017
1 parent 9a07cd5 commit e7ddfff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -2037,7 +2037,7 @@ bool QgsAttributeForm::fieldIsEditable( int fieldIndex ) const
int srcFieldIndex;
const QgsVectorLayerJoinInfo *info = mLayer->joinBuffer()->joinForFieldIndex( fieldIndex, mLayer->fields(), srcFieldIndex );

if ( !info->hasUpsertOnEdit() && mMode == QgsAttributeForm::AddFeatureMode )
if ( info && !info->hasUpsertOnEdit() && mMode == QgsAttributeForm::AddFeatureMode )
editable = false;
else if ( info && info->isEditable() && info->joinLayer()->isEditable() )
editable = fieldIsEditable( *( info->joinLayer() ), srcFieldIndex, mFeature.id() );
@@ -383,7 +383,7 @@ bool QgsGeoPackageConnectionItem::handleDrop( const QMimeData *data, Qt::DropAct
{
if ( isVector ) // Import vectors and aspatial
{
QgsVectorLayer *vectorSrcLayer = dynamic_cast < QgsVectorLayer * >( srcLayer );
QgsVectorLayer *vectorSrcLayer = qobject_cast < QgsVectorLayer * >( srcLayer );
QVariantMap options;
options.insert( QStringLiteral( "driverName" ), QStringLiteral( "GPKG" ) );
options.insert( QStringLiteral( "update" ), true );

0 comments on commit e7ddfff

Please sign in to comment.