Skip to content

Fix assets.map error on /search-results page#399

Open
JarvisInvestInsight wants to merge 1 commit intoNonprofit-Exchange-Hub:mainfrom
JarvisInvestInsight:fix/359-assets-map-error
Open

Fix assets.map error on /search-results page#399
JarvisInvestInsight wants to merge 1 commit intoNonprofit-Exchange-Hub:mainfrom
JarvisInvestInsight:fix/359-assets-map-error

Conversation

@JarvisInvestInsight
Copy link
Copy Markdown

Fixes #359

When navigating to /search-results?category=Offers or /search-results?category=Needs, the page crashes with an assets.map error. This happens when the API returns a non-array response (like an error object).

The fix adds Array.isArray() checks in two places:

  • AssetsList.tsx - guard before mapping over assets
  • SearchResults.tsx - validate response before setting state

Found this helpful? ☕ Buy me a coffee

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.

Fix bug in /search-results?category=Offers

1 participant