fix: improper handling of undefined api leading to crashes
This commit is contained in:
9 files changed
+73
-67
No files matched your search
@@ -125,8 +125,12 @@ export const playItem = (
|
||||
export const playItemFromQueue = async (
|
||||
index: "next" | "previous" | number,
|
||||
userId: string | undefined,
|
||||
api: Api,
|
||||
api: Api | undefined,
|
||||
) => {
|
||||
if (!api) {
|
||||
console.error("Unable to play item from from queue. No API provided");
|
||||
return;
|
||||
}
|
||||
const queueItems = useQueue.getState().tracks;
|
||||
const currentItemIndex = useQueue.getState().currentItemIndex;
|
||||
const requestedItemIndex =
|
||||
|
||||
Reference in new issue
Block a user