diff --git a/.github/badges/tests.svg b/.github/badges/tests.svg
index 1defd0b51..390300b87 100644
--- a/.github/badges/tests.svg
+++ b/.github/badges/tests.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocuments.m b/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocuments.m
index 7a3d4e073..01535268e 100644
--- a/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocuments.m
+++ b/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocuments.m
@@ -50,6 +50,9 @@
if (apiResponse.StatusCode == 200)
b = true;
answer = apiResponse.Body.Data;
+ if isfield(answer, 'documents') && isempty(answer.documents) && ~iscell(answer.documents)
+ answer.documents = {};
+ end
else
if isprop(apiResponse.Body, 'Data')
answer = apiResponse.Body.Data;
diff --git a/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocumentsAll.m b/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocumentsAll.m
index 4ba4aa6b7..df9a549f6 100644
--- a/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocumentsAll.m
+++ b/src/ndi/+ndi/+cloud/+api/+implementation/+documents/ListDatasetDocumentsAll.m
@@ -79,6 +79,9 @@
break; % Exit the main page loop
end
end
+ if isfield(answer, 'documents') && isempty(answer.documents) && ~iscell(answer.documents)
+ answer.documents = {};
+ end
end
end
end
diff --git a/tests/+ndi/+unittest/+cloud/DocumentsTest.m b/tests/+ndi/+unittest/+cloud/DocumentsTest.m
index 9267ad1d5..72a60dd35 100644
--- a/tests/+ndi/+unittest/+cloud/DocumentsTest.m
+++ b/tests/+ndi/+unittest/+cloud/DocumentsTest.m
@@ -304,7 +304,7 @@ function testBulkUploadAndDownload(testCase)
narrative(end+1) = "Bulk upload API call failed with an error: " + ME.message;
end
- msg_upload = "Bulk upload verification failed. Report: " + jsonencode(report_upload);
+ msg_upload = ndi.unittest.cloud.APIMessage(narrative, b_upload, report_upload, [], []);
testCase.verifyTrue(b_upload, msg_upload);
narrative(end+1) = "Bulk upload successful.";