Deal with empty string case.

This commit is contained in:
Jean Kossaifi
2021-01-09 22:14:16 +00:00
parent f77461b4b7
commit 169c45bb35

View File

@@ -320,7 +320,7 @@ class TocTree:
toctrees = [] # type: List[Element]
if 'includehidden' not in kwargs:
kwargs['includehidden'] = True
if 'maxdepth' not in kwargs:
if 'maxdepth' not in kwargs or not kwargs['maxdepth']:
kwargs['maxdepth'] = 0
else:
kwargs['maxdepth'] = int(kwargs['maxdepth'])