diff --git a/docs/source/upcoming_release_notes/565-poslimits.rst b/docs/source/upcoming_release_notes/565-poslimits.rst new file mode 100644 index 00000000..f48a7553 --- /dev/null +++ b/docs/source/upcoming_release_notes/565-poslimits.rst @@ -0,0 +1,23 @@ +565 poslimits +############# + +API Changes +----------- +- N/A + +Features +-------- +- N/A + +Bugfixes +-------- +- Avoid uncaught ``TypeError`` when ``None`` is present in a positioner + ``.limits``. + +Maintenance +----------- +- N/A + +Contributors +------------ +- klauer diff --git a/typhos/positioner.py b/typhos/positioner.py index 83a5b265..887075b4 100644 --- a/typhos/positioner.py +++ b/typhos/positioner.py @@ -314,7 +314,11 @@ def _link_limits_by_limits_attr(self): except Exception: ... else: - if low_limit < high_limit: + if low_limit is None or high_limit is None: + # Some devices may erroneously report `None` limits. + # TyphosPositioner will hide the limit labels in this scenario. + ... + elif low_limit < high_limit: self.ui.low_limit.setText(str(low_limit)) self.ui.high_limit.setText(str(high_limit)) return