From 5a20448590b1e866ea926ee150de72616dbb3707 Mon Sep 17 00:00:00 2001 From: James Acklin Date: Thu, 6 May 2021 10:49:48 -0400 Subject: [PATCH] permalinks: idx check + sane default --- pkg/interface/src/views/apps/permalinks/TranscludedNode.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/views/apps/permalinks/TranscludedNode.tsx b/pkg/interface/src/views/apps/permalinks/TranscludedNode.tsx index 107b1723e..72745b2f4 100644 --- a/pkg/interface/src/views/apps/permalinks/TranscludedNode.tsx +++ b/pkg/interface/src/views/apps/permalinks/TranscludedNode.tsx @@ -20,7 +20,7 @@ function TranscludedLinkNode(props: { api: GlobalApi; }) { const { node, api, assoc, transcluded } = props; - const idx = node?.post.index.slice(1).split('/'); + const idx = node?.post?.index?.slice(1).split('/') ?? []; switch (idx.length) { case 1: @@ -91,7 +91,7 @@ function TranscludedPublishNode(props: { }) { const { node, assoc, transcluded, api } = props; const group = useGroupForAssoc(assoc)!; - const idx = node?.post.index.slice(1).split('/'); + const idx = node?.post?.index?.slice(1).split('/') ?? []; switch (idx.length) { case 1: const post = node.children