[Bug]: Error adding new series if a series has null title in database #2364

Closed
opened 2026-04-25 00:06:32 +02:00 by adam · 4 comments
Owner

Originally created by @nichwall on GitHub (Nov 18, 2024).

What happened?

If the series table has a row where the title is null, a TypeError is thrown in the web client when trying to add a new series. Adding a book to an existing series is able to be completed successfully, but new series cannot be created.

The error occurs at https://github.com/advplyr/audiobookshelf/blob/2b0ba7d1e28f8cc0bcce153cbcde1a06927f93d9/client/components/widgets/SeriesInputWidget.vue#L90

What did you expect to happen?

Able to create a new series.

Steps to reproduce the issue

  1. Create a row in the series table where title is null
  2. Attempt to add a new series to a book in the web client

Audiobookshelf version

v2.17.0

How are you running audiobookshelf?

Built from source

What OS is your Audiobookshelf server hosted from?

Linux

If the issue is being seen in the UI, what browsers are you seeing the problem on?

None

Logs

TypeError: se.name is null

Additional Notes

No response

Originally created by @nichwall on GitHub (Nov 18, 2024). ### What happened? If the `series` table has a row where the title is `null`, a TypeError is thrown in the web client when trying to add a new series. Adding a book to an existing series is able to be completed successfully, but new series cannot be created. The error occurs at https://github.com/advplyr/audiobookshelf/blob/2b0ba7d1e28f8cc0bcce153cbcde1a06927f93d9/client/components/widgets/SeriesInputWidget.vue#L90 ### What did you expect to happen? Able to create a new series. ### Steps to reproduce the issue 1. Create a row in the `series` table where title is `null` 2. Attempt to add a new series to a book in the web client ### Audiobookshelf version v2.17.0 ### How are you running audiobookshelf? Built from source ### What OS is your Audiobookshelf server hosted from? Linux ### If the issue is being seen in the UI, what browsers are you seeing the problem on? None ### Logs ```shell TypeError: se.name is null ``` ### Additional Notes _No response_
adam added the bug label 2026-04-25 00:06:32 +02:00
adam closed this issue 2026-04-25 00:06:32 +02:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 18, 2024):

Fixed in v2.17.1.

@github-actions[bot] commented on GitHub (Nov 18, 2024): Fixed in [v2.17.1](https://github.com/advplyr/audiobookshelf/releases/tag/v2.17.1).
Author
Owner

@advplyr commented on GitHub (Nov 18, 2024):

I fixed the error but we should be on the lookout for how to reproduce getting a series added to the db with a null title.

@advplyr commented on GitHub (Nov 18, 2024): I fixed the error but we should be on the lookout for how to reproduce getting a series added to the db with a `null` title.
Author
Owner

@nichwall commented on GitHub (Nov 18, 2024):

I spent some time after opening this issue to try and add a not null to relevant columns in the database to help clean this up, but have not been able to get it to work yet for the series table due to a delete cascade being triggered, which removes all rows from the bookSeries table.

Once I figure out how to do that I'll open a PR. Initial research looks like it will be a bit involved for the migration (not as easy as just adding a new index) and will be SQLite specific, but that should be fine for now since everyone is using SQLite (and if anyone is using a different database backend, they will already need to be patching stuff anyway).

This was found in DieselTech's database, I am not sure how it happened either.

@nichwall commented on GitHub (Nov 18, 2024): I spent some time after opening this issue to try and add a `not null` to relevant columns in the database to help clean this up, but have not been able to get it to work yet for the series table due to a `delete cascade` being triggered, which removes all rows from the `bookSeries` table. Once I figure out how to do that I'll open a PR. Initial research looks like it will be a bit involved for the migration (not as easy as just adding a new index) and will be SQLite specific, but that should be fine for now since everyone is using SQLite (and if anyone is using a different database backend, they will already need to be patching stuff anyway). This was found in DieselTech's database, I am not sure how it happened either.
Author
Owner

@advplyr commented on GitHub (Nov 18, 2024):

There are only a few places where Series get created so we can add a check there for null and throw an error or just reject the series.
Ideally it would be not null in the DB but we shouldn't be forced to make a dialect specific update if we don't have to

@advplyr commented on GitHub (Nov 18, 2024): There are only a few places where Series get created so we can add a check there for null and throw an error or just reject the series. Ideally it would be not null in the DB but we shouldn't be forced to make a dialect specific update if we don't have to
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#2364