Skip to content

Commit 03d506d

Browse files
committed
returining if time is null
1 parent 36d0c86 commit 03d506d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/accessvis/widgets/clock_widget.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@ def _make_mpl(self):
3535
return fig, ax
3636

3737
def _update_mpl(self, fig, ax, time: datetime.time = None, **kwargs):
38+
if time is None:
39+
return
40+
3841
hour = time.hour
3942
minute = time.minute
4043
second = time.second
4144
angles_h = 2 * np.pi * hour / 12 + 2 * np.pi * minute / (12 * 60) + 2 * second / (12 * 60 * 60) - np.pi / 6.0
4245
angles_m = 2 * np.pi * minute / 60 + 2 * np.pi * second / (60 * 60) - np.pi / 6.0
4346
angles_s = 2 * np.pi * second / 60 - np.pi / 6.0
44-
if time is None:
45-
return
4647

4748
if self.show_seconds:
4849
lines = ax.plot([angles_s, angles_s], [0, 0.9], color=self.text_colour, linewidth=1)

0 commit comments

Comments
 (0)