diff --git a/src/edge_containers_cli/cmds/monitor.py b/src/edge_containers_cli/cmds/monitor.py index 051d55be..f9fa1d4a 100755 --- a/src/edge_containers_cli/cmds/monitor.py +++ b/src/edge_containers_cli/cmds/monitor.py @@ -183,16 +183,40 @@ def __init__( ) def __lt__(self, other: Any) -> bool: + # Handle None as values + if self.value is None and other.value is None: + return cast(bool, False) + elif self.value is None and other.value is not None: + return cast(bool, False) + elif self.value is not None and other.value is None: + return cast(bool, True) + if type(other) != SortableText: return NotImplemented return cast(bool, self.value < other.value) def __gt__(self, other: Any) -> bool: + # Handle None as values + if self.value is None and other.value is None: + return cast(bool, False) + elif self.value is None and other.value is not None: + return cast(bool, True) + elif self.value is not None and other.value is None: + return cast(bool, False) + if type(other) != SortableText: return NotImplemented return cast(bool, self.value > other.value) def __eq__(self, other: Any) -> bool: + # Handle None as values + if self.value is None and other.value is None: + return cast(bool, True) + elif self.value is None and other.value is not None: + return cast(bool, False) + elif self.value is not None and other.value is None: + return cast(bool, False) + if type(other) != SortableText: return NotImplemented return cast(bool, self.value == other.value)