mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-02-02 00:18:08 +00: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);
|
||||
}
|
||||
} 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,
|
||||
userId: user?.Id,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user