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

Closed
opened 2026-02-20 02:08:47 -05:00 by deekerman · 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
deekerman 2026-02-20 02:08:47 -05:00
  • closed this issue
  • added the
    bug
    label
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.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/audiobookshelf#1913
No description provided.