Skip to content

Commit

Permalink
Merge pull request #558 from zkamvar/znk-fix-550
Browse files Browse the repository at this point in the history
Add catch for None type code block in lesson_check
  • Loading branch information
zkamvar authored Mar 11, 2021
2 parents a283c4b + cce6a66 commit 091d31a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/lesson_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ def check_codeblock_classes(self):

for node in self.find_all(self.doc, {'type': 'codeblock'}):
cls = self.get_val(node, 'attr', 'class')
self.reporter.check(cls in KNOWN_CODEBLOCKS or cls.startswith('language-'),
self.reporter.check(cls is not None and (cls in KNOWN_CODEBLOCKS or
cls.startswith('language-')),
(self.filename, self.get_loc(node)),
'Unknown or missing code block type {0}',
cls)
Expand Down

0 comments on commit 091d31a

Please sign in to comment.