Sentry fix: Avoid throwing when reporting an error in the editing session

This commit is contained in:
Ben Gotow
2025-07-15 10:11:48 -05:00
parent 8dcc27a170
commit 307dbfda32

View File

@@ -106,7 +106,7 @@ function hotwireDraftBodyState(draft: any, session: DraftEditingSession): Messag
// equivalent document of the same shape.
AppEnv.reportError(new Error(`Unable to insert fragment into existing document.`), {
underlyingError: err,
existingSlateShape: convertToShapeWithoutContent(session._mountedEditor.value),
existingSlateShape: session._mountedEditor ? convertToShapeWithoutContent(session._mountedEditor.value) : null,
incomingSlateShape: convertToShapeWithoutContent(inHTMLEditorValue),
});
_bodyEditorValue = inHTMLEditorValue;