Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 1ab294b

Browse files
committed
IntegerParameterType: ensure that Min <= Max
Otherwise, error out and inform the user that the range of allowed values is empty. Signed-off-by: David Wagner <[email protected]>
1 parent cba27ea commit 1ab294b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

parameter/IntegerParameterType.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ class CIntegerParameterType : public CBaseIntegerParameterType
9696
xmlElement.getAttribute("Min", _min);
9797
xmlElement.getAttribute("Max", _max);
9898

99+
if (_min > _max) {
100+
serializingContext.setError("The range of allowed value is empty (Min > Max).");
101+
return false;
102+
}
103+
99104
// Base
100105
return Base::fromXml(xmlElement, serializingContext);
101106
}

0 commit comments

Comments
 (0)