Skip to content

Fix: 'NoneType' crash in get_project_mag_ratios_from_response on wallet v5.5.0#66

Merged
makeasnek merged 1 commit into
makeasnek:mainfrom
SyntaxError-PEBKAC:SyntaxError-PEBKAC-patch-1
Jun 8, 2026
Merged

Fix: 'NoneType' crash in get_project_mag_ratios_from_response on wallet v5.5.0#66
makeasnek merged 1 commit into
makeasnek:mainfrom
SyntaxError-PEBKAC:SyntaxError-PEBKAC-patch-1

Conversation

@SyntaxError-PEBKAC

Copy link
Copy Markdown
Contributor

Closes #65

Environment

  • FindTheMag 3.5 (reports as 3.3 in log — known version string bug)
  • Gridcoin wallet v5.5.0.0-5, Windows 1125H2
  • Python 3.11.9

Bug
FTM crashes with 'NoneType' object has no attribute 'upper' when fetching mag ratios from the wallet at startup. Falls back to web, crashes there too. BOINC control still runs but all mag ratios are zero.

Root cause
get_project_mag_ratios_from_response() calls grc_project_name_to_url() for each project in contract_contents.projects. When that returns None (unresolvable project name), it flows unchecked into resolve_url_database(), which calls .upper() unconditionally on line 155.

Fix
Added None guard before resolve_url_database() call. Unresolvable projects are logged at DEBUG and skipped.

Tested on
wallet v5.5.0.0-5 — mag ratios now fetch successfully from wallet at startup.

…RL unresolvable

Claude Sonnet 4.6 assisted me with resolving this issue and submitting my first PR ever. Verify my changes before submitting please.
@makeasnek makeasnek merged commit 0420831 into makeasnek:main Jun 8, 2026
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

Successfully merging this pull request may close these issues.

Bug: 'NoneType' object has no attribute 'upper' crashes mag ratio fetch on wallet v5.5.0

2 participants