mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 18:11:10 +00:00
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:
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>
|
||||
`;
|
||||
|
||||
|
||||
Reference in new issue
Block a user