usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

Fix LPS rendering failure when no components in metadata #308

Closed RayPlante closed 1 year ago

RayPlante commented 1 year ago

This fixes a bug discovered by @pjl1000: the landing page will fail to render if the NERDm record does not include a components property. (Note that this is not a required property.) The fix requires the addition of a guard into the useMetadata() function in LandingPageComponent that ensures the property's existence before attempting to calculate the total size of all files combined.