Describe the bug
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:
from howlongtobeatpy.JSONResultParser import JSONResultParser
p = 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.
Describe the bug
JSONResultParser.parse_json_element()checks whether completion-time keys exist, but then divides their values by 3600 without checking forNone. Its comment says to calculate only when the value is not None; a syntheticcomp_main: nullinstead raisesTypeError.To Reproduce
Without making any request:
I loaded the parser and its entry class from the checkout for this local test, without loading the HTTP implementation. Control inputs
comp_main=0andcomp_main=3600yield0.0and1.0respectively.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.