Skip to content

Commit 497637b

Browse files
authored
Merge pull request #7354 from m-kuhn/rangewidget_nostep
Handle invalid step size
2 parents 76f574a + 2469c9e commit 497637b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/gui/editorwidgets/qgsrangewidgetwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
138138
int minval = min.toInt();
139139
if ( allowNull )
140140
{
141-
int stepval = step.toInt();
141+
int stepval = step.isValid() ? step.toInt() : 1;
142142
minval -= stepval;
143143
mIntSpinBox->setValue( minval );
144144
mIntSpinBox->setSpecialValueText( QgsApplication::nullRepresentation() );

tests/src/python/test_provider_postgres.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ def testTransactionConstrains(self):
479479

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

484484
def testTransactionTuple(self):
485485
# create a vector layer based on postgres

0 commit comments

Comments
 (0)