Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid rare NoneType is not subscriptable error #191

Open
frozenpandaman opened this issue Sep 16, 2024 · 0 comments
Open

Avoid rare NoneType is not subscriptable error #191

frozenpandaman opened this issue Sep 16, 2024 · 0 comments

Comments

@frozenpandaman
Copy link
Owner

Apparently this is possible, reported by a user:

Traceback (most recent call last):
  File "C:\Users\Kyle\s3s\s3s.py", line 2060, in <module>
    main()
  File "C:\Users\Kyle\s3s\s3s.py", line 2028, in main
    check_if_missing(which, blackout, test_run, skipprefetch) # monitoring mode hasn't begun yet
  File "C:\Users\Kyle\s3s\s3s.py", line 1484, in check_if_missing
    fetch_and_upload_single_result(id, noun, isblackout, istestrun)
  File "C:\Users\Kyle\s3s\s3s.py", line 1401, in fetch_and_upload_single_result
    post_result(result, False, isblackout, istestrun) # not monitoring mode
  File "C:\Users\Kyle\s3s\s3s.py", line 1193, in post_result
    payload = prepare_battle_result(results[i]["data"], ismonitoring, isblackout, overview_data)
  File "C:\Users\Kyle\s3s\s3s.py", line 500, in prepare_battle_result
    full_id = utils.b64d(battle["id"])
TypeError: 'NoneType' object is not subscriptable

Which would mean battle had a vsHistoryDetail key in it, but then that in turn was null?

s3s/s3s.py

Lines 496 to 500 in fdd5ae8

battle = battle["vsHistoryDetail"]
## UUID ##
##########
full_id = utils.b64d(battle["id"])

Sounds like an error on Nintendo's end...? Anyway, we should exit gracefully here instead of crashing. To-do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant