fix(lib): a class can now have zero slide and work (#125)

* fix(lib): a class can now have zero slide and work

This fixes a previous issue that occured when a class didn't have any `pause`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Jérome Eertmans
2023-02-08 18:58:54 +01:00
committed by GitHub
parent ac23949043
commit 7b9c9b0c39

View File

@ -106,7 +106,10 @@ class Slide(Scene): # type:ignore
def add_last_slide(self) -> None:
"""Adds a 'last' slide to the end of slides."""
if self.current_animation == self.slides[-1].end_animation:
if (
len(self.slides) > 0
and self.current_animation == self.slides[-1].end_animation
):
self.slides[-1].type = SlideType.last
return