diff --git a/front_end/src/Components/Common/ErrorSummary/index.jsx b/front_end/src/Components/Common/ErrorSummary/index.jsx
index af1c054c..a982bd2e 100644
--- a/front_end/src/Components/Common/ErrorSummary/index.jsx
+++ b/front_end/src/Components/Common/ErrorSummary/index.jsx
@@ -12,13 +12,15 @@ export default function ErrorSummary({ errors }) {
- {errors.map((error) => {
- return (
- -
- {error.message}
-
- );
- })}
+ {errors &&
+ Array.isArray(errors) &&
+ errors.map((error) => {
+ return (
+ -
+ {error.message}
+
+ );
+ })}
diff --git a/front_end/src/Components/Notes/NotesCell.jsx b/front_end/src/Components/Notes/NotesCell.jsx
index 53f3484f..dffefa79 100644
--- a/front_end/src/Components/Notes/NotesCell.jsx
+++ b/front_end/src/Components/Notes/NotesCell.jsx
@@ -1,5 +1,6 @@
import React, { useState } from "react";
import { getURLSegment, postJsonData } from "../../Util";
+import ErrorSummary from "../Common/ErrorSummary";
const Modal = ({ isOpen, notes, employee_no, onClose, onSave }) => {
const charLimit = 200;
@@ -10,8 +11,8 @@ const Modal = ({ isOpen, notes, employee_no, onClose, onSave }) => {
const [charLeft, setCharLeft] = useState(currentLimit);
const [errorMessage, setErrorMessage] = useState("");
const [isSubmitting, setIsSubmitting] = useState(false);
- const financialYear = window.financialYear;
- const costCentre = window.costCentreCode;
+ const financialYear = String(window.financialYear);
+ const costCentre = String(window.costCentreCode);
if (!isOpen) return null;
@@ -66,7 +67,10 @@ const Modal = ({ isOpen, notes, employee_no, onClose, onSave }) => {