Fix TypeError: Cannot read properties of null (reading 'trim') in UserProfile component
🐞 Bug Report
Summary: UserProfile component crashes with TypeError: Cannot read properties of null (reading 'trim') when contribution items contain null or undefined values.
Steps to Reproduce:
-
Run the application.
-
Navigate to the Profile tab.
-
Ensure the API returns contribution items where fields like title, description, release_rights, or language are null.
-
Observe that the page crashes and no profile data is displayed.
Expected Behavior: The UserProfile component should handle null or undefined values safely, and valid API data should render without crashing.
Actual Behavior: The component attempts to call .trim() on null or undefined, leading to:
TypeError: Cannot read properties of null (reading 'trim')