Fixes the home page crashing when a library has no cover image

This commit is contained in:
BinaryAlley committed 2026-08-09 12:20:02 -07:00
1 parent 361dd66f76
commit b008a70a0d
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>
`;