Skip to content

Commit

Permalink
prevent min max values for bool as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelarguedas committed Sep 20, 2018
1 parent 493df1f commit 8cc924a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dynamic_reconfigure/parameter_generator_catkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ def add(self, name, paramtype, level, description, default=None, min=None, max=N
'srcfile': inspect.getsourcefile(inspect.currentframe().f_back.f_code),
'edit_method': edit_method,
}
if paramtype == str_t and (max is not None or min is not None):
raise Exception("Max or min specified for %s, which is of string type" % name)
if (paramtype == str_t or paramtype == bool_t) and (max is not None or min is not None):
raise Exception(
"Max or min specified for %s, which is of '%s' type" % (name, paramtype))
check_name(name)
self.gen.fill_type(newparam)
self.gen.check_type_fill_default(newparam, 'default', self.gen.defval[paramtype])
Expand Down

0 comments on commit 8cc924a

Please sign in to comment.