From 9d303d265d6439e6683d07ccef78a34205232b79 Mon Sep 17 00:00:00 2001 From: Joe R Date: Wed, 2 Mar 2022 21:49:38 -0500 Subject: [PATCH] Code to prevent error when letters are missing. --- pysollib/images.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pysollib/images.py b/pysollib/images.py index dc6c8232..5c9e5a14 100644 --- a/pysollib/images.py +++ b/pysollib/images.py @@ -220,14 +220,16 @@ class Images: # load letters for rank in range(self.cs.nletters): name = "l%02d" % (rank + 1) - self._letter_positive.append( - self.__loadBottom(name, color='black')) + bottom = self.__loadBottom(name, color='black') + if bottom is not None: + self._letter_positive.append(bottom) if progress: progress.update(step=pstep) # load negative letters name = "l%02d-n" % (rank + 1) - self._letter_negative.append( - self.__loadBottom(name, color='white')) + bottom = self.__loadBottom(name, color='white') + if bottom is not None: + self._letter_negative.append(bottom) if progress: progress.update(step=pstep)