diff --git a/packages/perseus-editor/src/widgets/group-editor.tsx b/packages/perseus-editor/src/widgets/group-editor.tsx index 1b5f6b4dc5..bdd21c3c08 100644 --- a/packages/perseus-editor/src/widgets/group-editor.tsx +++ b/packages/perseus-editor/src/widgets/group-editor.tsx @@ -3,6 +3,7 @@ import {ApiOptions, Changeable} from "@khanacademy/perseus"; import PropTypes from "prop-types"; import * as React from "react"; +import invariant from "tiny-invariant"; import _ from "underscore"; import Editor from "../editor"; @@ -69,7 +70,8 @@ class GroupEditor extends React.Component { return Changeable.change.apply(this, args); }; - getSaveWarnings: () => ReadonlyArray = () => { + getSaveWarnings: () => ReadonlyArray = () => { + invariant(this.editor.current != null); return this.editor.current?.getSaveWarnings(); };