Skip to content

Commit

Permalink
Handle references w/out sections in Links
Browse files Browse the repository at this point in the history
  • Loading branch information
EliezerIsrael committed May 31, 2015
1 parent edbd6d6 commit f4e71bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sefaria/client/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def format_link_object_for_client(link, with_text, ref, pos=None):
com["anchorRef"] = anchorRef.normal()
com["sourceRef"] = linkRef.normal()
com["sourceHeRef"] = linkRef.he_normal()
com["anchorVerse"] = anchorRef.sections[-1]
com["anchorVerse"] = anchorRef.sections[-1] if len(anchorRef.sections) else 0
com["commentaryNum"] = linkRef.sections[-1] if linkRef.type == "Commentary" else 0
com["anchorText"] = getattr(link, "anchorText", "")

Expand Down

0 comments on commit f4e71bb

Please sign in to comment.