Show better error message when WikiTree ID doesn't exist

This commit is contained in:
Przemek Więch 2022-10-30 14:54:22 +01:00
parent f761eea8f1
commit 033a86a05a

View File

@ -138,7 +138,7 @@ export async function loadWikiTree(
// Fetch the ancestors of the input person and ancestors of his/her spouses.
const firstPerson = await getRelatives([key], handleCors);
if (!firstPerson[0].Name) {
if (!firstPerson[0]?.Name) {
const id = key;
throw new TopolaError(
'WIKITREE_PROFILE_NOT_ACCESSIBLE',