[Bug]: "See Year in Review" crashes the app #1741

Closed
opened 2026-04-24 23:56:30 +02:00 by adam · 3 comments
Owner

Originally created by @plague-doctor on GitHub (Feb 16, 2024).

Describe the issue

Container crashes with:

/server/utils/queries/userStats.js:144
        const genres = (ls.mediaMetadata.genres || []).filter(g => !g.toLowerCase().includes('audiobook') && !g.toLowerCase().includes('audio book'))
                                                                      ^
TypeError: Cannot read properties of null (reading 'toLowerCase')
    at /server/utils/queries/userStats.js:144:71
    at Array.filter (<anonymous>)
    at Object.getStatsForYear (/server/utils/queries/userStats.js:144:56)
    at async ApiRouter.getStatsForYear (/server/controllers/MeController.js:350:18)

when trying to "See Year in Review"

Steps to reproduce the issue

  1. Stats
  2. See Year in Review

Audiobookshelf version

v2.7.2

How are you running audiobookshelf?

Docker

Originally created by @plague-doctor on GitHub (Feb 16, 2024). ### Describe the issue Container crashes with: ``` /server/utils/queries/userStats.js:144 const genres = (ls.mediaMetadata.genres || []).filter(g => !g.toLowerCase().includes('audiobook') && !g.toLowerCase().includes('audio book')) ^ TypeError: Cannot read properties of null (reading 'toLowerCase') at /server/utils/queries/userStats.js:144:71 at Array.filter (<anonymous>) at Object.getStatsForYear (/server/utils/queries/userStats.js:144:56) at async ApiRouter.getStatsForYear (/server/controllers/MeController.js:350:18) ``` when trying to "See Year in Review" ### Steps to reproduce the issue 1. Stats 2. See Year in Review ### Audiobookshelf version v2.7.2 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:56:30 +02:00
adam closed this issue 2026-04-24 23:56:31 +02:00
Author
Owner

@advplyr commented on GitHub (Feb 16, 2024):

Somehow you have a listening session with a null genre.

@advplyr commented on GitHub (Feb 16, 2024): Somehow you have a listening session with a null genre.
Author
Owner

@izyspania commented on GitHub (Feb 19, 2024):

With server in dev mode the refresh on See Year in Review is crashing for me.
image
image

@izyspania commented on GitHub (Feb 19, 2024): With server in dev mode the refresh on See Year in Review is crashing for me. ![image](https://github.com/advplyr/audiobookshelf/assets/93366907/0e236bbc-01da-4eba-ad32-0f4a13726786) ![image](https://github.com/advplyr/audiobookshelf/assets/93366907/858e0bda-6199-415a-9209-02bc69e060a6)
Author
Owner

@advplyr commented on GitHub (Feb 20, 2024):

Fixed in v2.8.0

@advplyr commented on GitHub (Feb 20, 2024): Fixed in [v2.8.0](https://github.com/advplyr/audiobookshelf/releases/tag/v2.8.0)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#1741