Skip to content

Commit bbcdd9f

Browse files
authored
Only create subheading if we have class docs (#4126)
The current docs crash for example when accessing `/documentation/user`. This PR fixes the issue introduced by #4115.
1 parent 4916e91 commit bbcdd9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

website/documentation/reference.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def generate_class_doc(class_obj: type, part_title: str) -> None:
1111
"""Generate documentation for a class including all its methods and properties."""
1212
doc = class_obj.__doc__ or class_obj.__init__.__doc__
13-
if ':param' in doc:
13+
if doc and ':param' in doc:
1414
subheading('Initializer', anchor_name=create_anchor_name(part_title.replace('Reference', 'Initializer')))
1515
description = remove_indentation(doc.split('\n', 1)[-1])
1616
lines = [line.replace(':param ', ':') for line in description.splitlines() if ':param' in line]

0 commit comments

Comments
 (0)