Skip to content

Conversation

@AneeshPal
Copy link

Description

This PR fixes a runtime crash on the Browse page when the backend API is unavailable or returns undefined data.

The crash occurred because some fields were accessed without null checks.

Changes

  • Added optional chaining for uploadname in the filter logic
  • Added optional chaining for uploaddate before calling .split()
  • Prevented runtime error when API data is missing

How to test

  1. Run the UI without backend or with an undefined API URL
  2. Start the frontend using:
    npm run dev
  3. Open the Browse page
  4. Confirm:
    • The page loads without crashing
    • No "Cannot read properties of undefined" error appears

Hello, this is my first contribution to FOSSology UI.
Please let me know if any changes are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant