diff --git a/js/components/portal-dashboard/answers/image-answer.tsx b/js/components/portal-dashboard/answers/image-answer.tsx index 21bb61bf..254a3ab3 100644 --- a/js/components/portal-dashboard/answers/image-answer.tsx +++ b/js/components/portal-dashboard/answers/image-answer.tsx @@ -64,7 +64,7 @@ export const ImageAnswer: React.FC = (props) => { const imgWidth = aspectRatio > 0 ? (constrainX ? containerWidth : containerHeight / aspectRatio) : 0; const imgHeight = aspectRatio > 0 ? (constrainX ? containerWidth / aspectRatio : containerHeight) : 0; - if (!imgAnswer) { + if (!imgAnswer || typeof imgAnswer.get !== "function") { // There are broken answer documents that do not include an answer field // Don't crash, just provide a error message to the teacher // This needs to happen after all of the useState calls otherwise React will get