Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not crash if there is no savepoint
  • Loading branch information
m-kuhn committed Nov 3, 2017
1 parent 8bfa3eb commit 479970b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/qgsvectorlayerundopassthroughcommand.cpp
Expand Up @@ -31,7 +31,8 @@

QgsVectorLayerUndoPassthroughCommand::QgsVectorLayerUndoPassthroughCommand( QgsVectorLayerEditBuffer *buffer, const QString &text, bool autocreate )
: QgsVectorLayerUndoCommand( buffer )
, mSavePointId( mBuffer->L->isEditCommandActive() || !autocreate
, mSavePointId( mBuffer->L->isEditCommandActive() && !mBuffer->L->dataProvider()->transaction()->savePoints().isEmpty()
|| !autocreate
? mBuffer->L->dataProvider()->transaction()->savePoints().last()
: mBuffer->L->dataProvider()->transaction()->createSavepoint( mError ) )
, mHasError( !mError.isEmpty() )
Expand Down

0 comments on commit 479970b

Please sign in to comment.