Sfoglia il codice sorgente

fix(useSoundcloudPlayer): eventListenerCallbacks[data.method] is undefined

Owen Diffey 2 anni fa
parent
commit
ca7f0b66cd
1 ha cambiato i file con 4 aggiunte e 3 eliminazioni
  1. 4 3
      frontend/src/composables/useSoundcloudPlayer.ts

+ 4 - 3
frontend/src/composables/useSoundcloudPlayer.ts

@@ -97,9 +97,10 @@ export const useSoundcloudPlayer = () => {
 
 			if (readyCallback.value) readyCallback.value();
 
-			eventListenerCallbacks[data.method].forEach(callback => {
-				callback(data.value);
-			});
+			if (eventListenerCallbacks[data.method])
+				eventListenerCallbacks[data.method].forEach(callback => {
+					callback(data.value);
+				});
 
 			return;
 		}