Radio++ (radio@driglu4it): saveStations() lacks null-guard on external station data (same class as #9000)

Open Beginner friendly
#9,007 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
api, desktop

Research direction

Open src/ui/RadioPopupMenu/UpdateStationsMenuItem.ts and start at the saveStations() success callback that maps radio-browser.info responses. Check the handling of name and url when either is null or missing; done means malformed station entries no longer throw and the update flow can complete.

Written by the indexing model from the issue text.

Description

In src/ui/RadioPopupMenu/UpdateStationsMenuItem.ts, the saveStations() success callback runs name.trim() / url.trim() unguarded on data returned by the radio-browser.info API. The RadioStation interface declares these as required strings, but nothing at runtime enforces that against the actual API response — a station entry with a missing/null name or url will throw.

This is the same class of defect as #9000 (missing null-safety on data crossing an external/API boundary), just a different call site. If it fires, it likely also triggers the "stuck on Updating..." behavior described in the sibling issue about HttpHandler.ts's missing try/catch, since it happens mid-callback inside the same update flow.

Suggested fix: (name ?? '').trim() / (url ?? '').trim(), or filter out entries with falsy name/url before mapping.

Dominant language
JavaScript
Stars
758
Forks
729
Avg merge
9h 47m
Merged PRs (30d)
19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from linuxmint/cinnamon-spices-applets

All issues in linuxmint/cinnamon-spices-applets

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.