Sven 1 рік тому
батько
коміт
d43221a1f7
2 змінених файлів з 5 додано та 2 видалено
  1. 3 0
      src/features/lyrics.ts
  2. 2 2
      src/features/songLists.ts

+ 3 - 0
src/features/lyrics.ts

@@ -190,6 +190,9 @@ export async function getCurrentLyricsUrl() {
       }
       }
     }
     }
 
 
+    if(!artistName)
+      return undefined;
+
     const url = await fetchLyricsUrl(sanitizeArtists(artistName), sanitizeSong(songName));
     const url = await fetchLyricsUrl(sanitizeArtists(artistName), sanitizeSong(songName));
 
 
     if(url) {
     if(url) {

+ 2 - 2
src/features/songLists.ts

@@ -115,8 +115,8 @@ async function addQueueButtons(
       e.preventDefault();
       e.preventDefault();
       e.stopImmediatePropagation();
       e.stopImmediatePropagation();
 
 
-      let song: string | undefined,
-        artist: string | undefined;
+      let song: string | null | undefined,
+        artist: string | null | undefined;
 
 
       if(listType === "currentQueue") {
       if(listType === "currentQueue") {
         const songInfo = queueItem.querySelector<HTMLElement>(".song-info");
         const songInfo = queueItem.querySelector<HTMLElement>(".song-info");