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 e7ddfff09d9da3d4a05af1f8cd9c7badce2ba435
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/gui/qgsattributeform.cpp
  2. +1 −1 src/providers/ogr/qgsgeopackagedataitems.cpp
@@ -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.
You can’t perform that action at this time.