From 7da664a3dd312b6a857a60c32425bea17c6c8695 Mon Sep 17 00:00:00 2001 From: Kenneth Jiang Date: Sat, 21 Dec 2024 13:42:54 -0800 Subject: [PATCH] fix https://sentry.obico.io/organizations/sentry/issues --- moonraker_obico/printer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moonraker_obico/printer.py b/moonraker_obico/printer.py index fe2e4dd..1af79f6 100644 --- a/moonraker_obico/printer.py +++ b/moonraker_obico/printer.py @@ -266,7 +266,8 @@ def get_z_info(self): current_layer = min(total_layers, current_layer) # Apparently the previous calculation can result in current_layer > total_layers in some cases... current_layer = max(current_layer, 0) # Apparently the previous calculation can result in negative number in some cases... - if max_z and current_z > max_z: current_z = 0 # prevent buggy looking flicker on print start + if max_z is not None and current_z is not None and current_z > max_z: + current_z = 0 # prevent buggy looking flicker on print start if current_layer is None or total_layers is None or is_not_busy or not has_print_duration: # edge case handling - if either are not available we show nothing / show nothing if paused state, transient, etc / show nothing if no print duration (prevents tracking z height during preheat & start bytes) current_layer = None total_layers = None