Merge pull request #134 from BinaryAlley/bugfix/home-index-null-cover-image

Fixes the home page crashing when a library has no cover image
This commit is contained in:
BinaryAlley authored and GitHub committed 2026-08-09 02:27:13 -07:00
commit 4fec67a1f8
1 file changed
+6 -1
@@ -43,8 +43,13 @@
const libraryDiv = document.createElement('div');
libraryDiv.className = 'media-panel';
// the cover image is optional, so it is only rendered when the library has one
const coverImageHtml = library.coverImage
? `<img src="${globalConfiguration.serverBasePath}/media/libraries/${library.id}/${library.coverImage.substring(library.coverImage.lastIndexOf('cover.'))}" />`
: '';
libraryDiv.innerHTML = `
<img src="${globalConfiguration.serverBasePath}/media/libraries/${library.id}/${library.coverImage.substring(library.coverImage.lastIndexOf('cover.'))}" />
${coverImageHtml}
<span class="text-light-two"><strong>${library.title}</strong></span>
`;