mirror of
https://github.com/navidrome/navidrome.git
synced 2026-10-08 18:37:09 +02:00
The native API endpoints GET /playlist/{id}/tracks and
GET /playlist/{id}/tracks/{id} were panicking with a nil pointer
dereference (resulting in a 500) when the playlist did not exist.
This happened because Tracks() returns nil for missing playlists,
and the nil repository was passed directly to the rest handler.
Extracted a shared playlistTracksHandler that checks for nil and
returns 404 early. Added tests covering both the error and happy paths.
|
||
|---|---|---|
| .. | ||
| config.go | ||
| config_test.go | ||
| inspect.go | ||
| library.go | ||
| library_test.go | ||
| missing.go | ||
| native_api.go | ||
| native_api_song_test.go | ||
| native_api_suite_test.go | ||
| playlists.go | ||
| playlists_test.go | ||
| plugin.go | ||
| plugin_test.go | ||
| queue.go | ||
| queue_test.go | ||
| translations.go | ||
| translations_test.go | ||