From 00a44ed4b0011ca6967f5d1512aa9fd1f6a1bdfe Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 21 Jan 2020 00:39:21 -0500 Subject: fix to avoid crash when rendering a non-string in an EditableView (eg when the document's title is displayed as a richtextBox and as an EditableView header on a DocumentView) --- src/client/views/EditableView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index faf02b946..0d677b8ce 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -5,6 +5,7 @@ import "./EditableView.scss"; import * as Autosuggest from 'react-autosuggest'; import { undoBatch } from '../util/UndoManager'; import { SchemaHeaderField } from '../../new_fields/SchemaHeaderField'; +import { ObjectField } from '../../new_fields/ObjectField'; export interface EditableProps { /** @@ -152,7 +153,7 @@ export class EditableView extends React.Component { />; } else { if (this.props.autosuggestProps) this.props.autosuggestProps.resetValue(); - return ( + return (this.props.contents instanceof ObjectField ? (null) :
-- cgit v1.2.3-70-g09d2