You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Null optional completion times raise TypeError in JSONResultParser #60
JSONResultParser.parse_json_element() checks whether completion-time keys exist, but then divides their values by 3600 without checking for None. Its comment says to calculate only when the value is not None; a synthetic comp_main: null instead raises TypeError.
To Reproduce
Without making any request:
fromhowlongtobeatpy.JSONResultParserimportJSONResultParserp=JSONResultParser('Example', 'https://example.com', 0)
p.parse_json_element({'game_id': 1, 'game_name': 'Example', 'comp_main': None})
# TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
I loaded the parser and its entry class from the checkout for this local test, without loading the HTTP implementation. Control inputs comp_main=0 and comp_main=3600 yield 0.0 and 1.0 respectively.
Expected behavior
Treat a null optional completion time as unavailable, keeping the entry field None, while preserving zero and ordinary numeric values. Apply the same handling to the other optional time fields (comp_plus, comp_100, comp_all, invested_co, invested_mp).
HLTB API Version
Current repository source, Python 3.14.6, macOS arm64. This is a synthetic parser robustness reproduction, not a claim that I captured a current live API response containing null values.
This is separate from search discovery / bot-protection reports and the platform accessor issue. Existing issues and open PRs were checked. Happy to contribute a focused parser regression/fix if accepted. AI assistance was used; output reproduced locally.
Activity
Jah-yee commentedon Oct 2, 2026
Submitted PR #61 with the fix - added 'is not None' checks to all 6 completion time fields. py_compile verified.
ScrappyCocco commentedon Oct 2, 2026
Merged but will wait for next release