publish: safety check note view

This commit is contained in:
Matilde Park 2020-10-05 15:29:51 -04:00
parent 0d72959d03
commit 1b73029bc9
2 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ interface AuthorProps {
}
export function Author(props: AuthorProps) {
const { contacts, ship, date, showImage } = props;
const { contacts, ship = '', date, showImage } = props;
const noSig = ship.slice(1);
const contact = noSig in contacts ? contacts[noSig] : null;
const color = contact?.color ? `#${uxToHex(contact?.color)}` : "#000000";

View File

@ -107,7 +107,7 @@ export function Note(props: NoteProps & RouteComponentProps) {
ship={props.ship}
book={props.book}
/>
{notebook.comments && (
{notebook?.comments && (
<Comments
ship={ship}
book={props.book}