Skip to content

Commit be253d4

Browse files
committed
GroupEditor: Handle ref being null - should not happen so using invariant()
1 parent 74816d7 commit be253d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/perseus-editor/src/widgets/group-editor.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import {ApiOptions, Changeable} from "@khanacademy/perseus";
44
import PropTypes from "prop-types";
55
import * as React from "react";
6+
import invariant from "tiny-invariant";
67
import _ from "underscore";
78

89
import Editor from "../editor";
@@ -69,7 +70,8 @@ class GroupEditor extends React.Component<Props> {
6970
return Changeable.change.apply(this, args);
7071
};
7172

72-
getSaveWarnings: () => ReadonlyArray<any> = () => {
73+
getSaveWarnings: () => ReadonlyArray<string> = () => {
74+
invariant(this.editor.current != null);
7375
return this.editor.current?.getSaveWarnings();
7476
};
7577

0 commit comments

Comments
 (0)