mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-20 04:40:27 +01:00
fix(player): add null check for api in direct-player
This commit is contained in:
@@ -231,7 +231,12 @@ export default function page() {
|
|||||||
setDownloadedItem(data);
|
setDownloadedItem(data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const res = await getUserLibraryApi(api!).getItem({
|
// Guard against api being null (e.g., during logout)
|
||||||
|
if (!api) {
|
||||||
|
setItemStatus({ isLoading: false, isError: false });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const res = await getUserLibraryApi(api).getItem({
|
||||||
itemId,
|
itemId,
|
||||||
userId: user?.Id,
|
userId: user?.Id,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user