Skip to content

Commit

Permalink
GroupEditor: Handle ref being null - should not happen so using invar…
Browse files Browse the repository at this point in the history
…iant()
  • Loading branch information
jeremywiebe committed Aug 12, 2024
1 parent 74816d7 commit be253d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/perseus-editor/src/widgets/group-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -69,7 +70,8 @@ class GroupEditor extends React.Component<Props> {
return Changeable.change.apply(this, args);
};

getSaveWarnings: () => ReadonlyArray<any> = () => {
getSaveWarnings: () => ReadonlyArray<string> = () => {
invariant(this.editor.current != null);
return this.editor.current?.getSaveWarnings();
};

Expand Down

0 comments on commit be253d4

Please sign in to comment.