diff --git a/src/context/Locale.tsx b/src/context/Locale.tsx
index 0385745c68392a63eb9f4ec5c833aea52d2380de..ea75394a78073f4dcca8bfb094945de575097184 100644
--- a/src/context/Locale.tsx
+++ b/src/context/Locale.tsx
@@ -127,7 +127,7 @@ function Locale({ children, locale }: Props) {
 
     function transformLanguage(obj: { [key: string]: any }) {
         const dayjs = obj.dayjs;
-        const defaults = dayjs.defaults;
+        const defaults = dayjs?.defaults;
 
         const twelvehour = defaults?.twelvehour === 'yes' || true;
         const separator: '/' | '-' | '.' = defaults?.date_separator ?? '/';