From f26554b86d17ff712370aad484f95faf53bafc67 Mon Sep 17 00:00:00 2001
From: Bjarke Madsen <bjarke@nordu.net>
Date: Wed, 19 Mar 2025 12:36:37 +0100
Subject: [PATCH] null is also an object, so check against that first

---
 Changelog.md                                                  | 4 ++++
 .../src/components/download/DownloadDataButton.tsx            | 1 +
 2 files changed, 5 insertions(+)

diff --git a/Changelog.md b/Changelog.md
index 3627d0b5..54561589 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -2,6 +2,10 @@
 
 All notable changes to this project will be documented in this file.
 
+
+## [0.94] - 2025-03-19
+- Fix Excel export for data that includes null values
+
 ## [0.93] - 2025-03-03
 - Fix CSV/Excel export for data that includes object/array values
 
diff --git a/compendium-frontend/src/components/download/DownloadDataButton.tsx b/compendium-frontend/src/components/download/DownloadDataButton.tsx
index 9ba9329d..07d0ab0e 100644
--- a/compendium-frontend/src/components/download/DownloadDataButton.tsx
+++ b/compendium-frontend/src/components/download/DownloadDataButton.tsx
@@ -11,6 +11,7 @@ interface DownloadProps {
 }
 
 function simplifyObjectOrArray(obj) {
+    if (obj == null) return obj
     if (Array.isArray(obj)) {
         return obj.map(simplifyObjectOrArray).join(', ');
     }
-- 
GitLab