Skip to content

Commit 63617ba

Browse files
committedJun 7, 2013
Fix crash when selecting invalid CRS in new spatialite dialog
1 parent 73e9c31 commit 63617ba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎src/app/qgsnewspatialitelayerdialog.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,12 @@ void QgsNewSpatialiteLayerDialog::on_pbnFindSRID_clicked()
251251
QgsCoordinateReferenceSystem srs;
252252
srs.createFromOgcWmsCrs( mySelector->selectedAuthId() );
253253
bool ok;
254-
mCrsId = srs.authid().split( ':' ).at( 1 ).toInt( &ok );
255-
leSRID->setText( srs.authid() + " - " + srs.description() );
254+
int crsId = srs.authid().split( ':' ).value( 1, QString::number( mCrsId ) ).toInt( &ok );
255+
if ( crsId != mCrsId )
256+
{
257+
mCrsId = crsId;
258+
leSRID->setText( srs.authid() + " - " + srs.description() );
259+
}
256260
}
257261
delete mySelector;
258262
}

0 commit comments

Comments
 (0)
Please sign in to comment.