Skip to content

Commit 4fe08d0

Browse files

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,15 +512,16 @@ void QgsVectorLayerProperties::apply()
512512
QgsVectorLayer::EditType editType = ( QgsVectorLayer::EditType ) cb->itemData( cb->currentIndex() ).toInt();
513513
layer->setEditType( idx, editType );
514514

515+
QString value = tblAttributes->item( i, 7 ) ? tblAttributes->item( i, 7 )->text() : QString::null;
516+
515517
if ( editType == QgsVectorLayer::ValueMap )
516518
{
517519
QMap<QString, QVariant> &map = layer->valueMap( idx );
518520
map.clear();
519521

520-
QString value = tblAttributes->item( i, 7 )->text();
521522
if ( !value.isEmpty() )
522523
{
523-
QStringList values = tblAttributes->item( i, 7 )->text().split( ";" );
524+
QStringList values = value.split( ";" );
524525
for ( int j = 0; j < values.size(); j++ )
525526
{
526527
QStringList args = values[j].split( "=" );
@@ -548,7 +549,7 @@ void QgsVectorLayerProperties::apply()
548549
else if ( editType == QgsVectorLayer::EditRange ||
549550
editType == QgsVectorLayer::SliderRange )
550551
{
551-
QStringList values = tblAttributes->item( i, 7 )->text().split( ";" );
552+
QStringList values = value.split( ";" );
552553

553554
if ( values.size() == 3 )
554555
{

0 commit comments

Comments
 (0)
Please sign in to comment.