Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #7371 from m-kuhn/backport_7354
Handle invalid step size
  • Loading branch information
m-kuhn committed Jul 6, 2018
2 parents ca2abb5 + 528aee0 commit 7db1535
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsrangewidgetwrapper.cpp
Expand Up @@ -138,7 +138,7 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
int minval = min.toInt();
if ( allowNull )
{
int stepval = step.toInt();
int stepval = step.isValid() ? step.toInt() : 1;
minval -= stepval;
mIntSpinBox->setValue( minval );
mIntSpinBox->setSpecialValueText( QgsApplication::nullRepresentation() );
Expand Down
2 changes: 1 addition & 1 deletion tests/src/python/test_provider_postgres.py
Expand Up @@ -479,7 +479,7 @@ def testTransactionConstrains(self):

# check new values
self.assertTrue(vl.getFeatures('id=1').nextFeature(f))
self.assertEqual(f.attributes(), [1, 1, NULL])
self.assertEqual(f.attributes(), [1, 1, 0])

def testTransactionTuple(self):
# create a vector layer based on postgres
Expand Down

0 comments on commit 7db1535

Please sign in to comment.