From 4cd02babbace98c01bcef153a50d34cb36dd1d4b Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <31414959+0xSysR3ll@users.noreply.github.com> Date: Mon, 24 Mar 2025 16:11:35 +0100 Subject: [PATCH] fix(ui): handle import-from-plex response as array (#1510) --- src/components/UserList/PlexImportModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/UserList/PlexImportModal.tsx b/src/components/UserList/PlexImportModal.tsx index 078d1f1a1..28bbc8981 100644 --- a/src/components/UserList/PlexImportModal.tsx +++ b/src/components/UserList/PlexImportModal.tsx @@ -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.'); }