Browse Source

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

Owen Diffey 1 year ago
parent
commit
ca7f0b66cd
1 changed files with 4 additions and 3 deletions
  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;
 		}