fix(ui): handle import-from-plex response as array (#1510)

This commit is contained in:
0xsysr3ll
2025-03-24 16:11:35 +01:00
committed by GitHub
parent f5b3a526cb
commit 4cd02babba

View File

@@ -57,9 +57,9 @@ const PlexImportModal = ({ onCancel, onComplete }: PlexImportProps) => {
}),
});
if (!res.ok) throw new Error();
const { data: createdUsers } = await res.json();
const createdUsers = await res.json();
if (!createdUsers.length) {
if (!Array.isArray(createdUsers) || createdUsers.length === 0) {
throw new Error('No users were imported from Plex.');
}