Skip to content

Commit 03b8f8c

Browse files
committed
fix(acms): Add optional chaining to handle undefined docketEntryDocuments
1 parent 9f162ec commit 03b8f8c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/appellate/appellate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -538,14 +538,14 @@ AppellateDelegate.prototype.handleAcmsDownloadPage = async function () {
538538
(entry) => entry.docketEntryId == downloadData.docketEntryId
539539
);
540540

541-
if (!docketEntryData.docketEntryDocuments.length) {
541+
if (!docketEntryData?.docketEntryDocuments?.length) {
542542
return { docketEntryData: null, documentData: null };
543543
}
544544

545545
// For entries with multiple attachments, match on the specific document
546546
// that was clicked. For single-document entries, use the only document.
547547
let documentData;
548-
if (docketEntryData.docketEntryDocuments.length > 1) {
548+
if (docketEntryData?.docketEntryDocuments?.length > 1) {
549549
documentData = docketEntryData.docketEntryDocuments.find(
550550
(doc) =>
551551
doc.docketDocumentDetailsId ==
@@ -655,13 +655,13 @@ AppellateDelegate.prototype.handleAcmsDownloadPage = async function () {
655655
(entry) => entry.docketEntryId == downloadData.docketEntryId
656656
);
657657

658-
if (!docketEntryData.docketEntryDocuments.length) return;
658+
if (!docketEntryData?.docketEntryDocuments?.length) return;
659659

660660
const pdfFileRequestBody =
661661
APPELLATE.createAcmsDocumentRequestBody(downloadData);
662662

663663
let docData = null;
664-
if (docketEntryData.docketEntryDocuments.length > 1) {
664+
if (docketEntryData?.docketEntryDocuments?.length > 1) {
665665
docData = docketEntryData.docketEntryDocuments.find(
666666
(doc) =>
667667
doc.docketDocumentDetailsId ==

0 commit comments

Comments
 (0)