Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit a956946

Browse files
committed
Fix: Missing subchapters in book avoid an exception.
1 parent 65903d4 commit a956946

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

runestone/server/componentdb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from sphinx.util import logging
3434
from sqlalchemy import create_engine, Table, MetaData, select, and_, or_
3535
from sqlalchemy.orm.session import sessionmaker
36-
import pdb
3736

3837
from runestone.common.runestonedirective import RunestoneDirective, RunestoneIdNode
3938

@@ -723,7 +722,8 @@ def update_chapter_subchapter(
723722
else:
724723
currentRowId = res.id
725724

726-
for sub in subtitles[chap]:
725+
# If this chapter doesn't have subchapters, then skip them -- hence, use ``subtitles.get(chap, [])`` instead of ``subtitles[chap]``.
726+
for sub in subtitles.get(chap, []):
727727
if (chap, sub) in skips:
728728
skipreading = "T"
729729
else:

0 commit comments

Comments
 (0)