researchhub-web icon indicating copy to clipboard operation
researchhub-web copied to clipboard

Fix issue with adding valid DOIs to ref manager

Open kerkelae opened this issue 7 months ago • 1 comments

This PR aims to solve https://github.com/ResearchHub/issues/issues/34.

The issue seems to have been issn.join failing if issn is null or not an array. The fix involves adding a check to ensure issn is an array before calling the join method. The updated code uses Array.isArray(issn) ? issn.join(", ") : "", which checks if issn is an array; if it is, it joins the array elements into a string separated by commas. If issn is not an array or is null, it defaults to an empty string. This prevents the application from throwing an error when trying to call join on a null value.

I ran the code locally and was able to add the DOI that caused the issue:

image

kerkelae avatar Jun 28 '24 14:06 kerkelae