Bug: Dynamic icon lookup in Home.jsx has no fallback (render crash risk) #125
Labels
No Label
P0 Critical
P1 High
P2 Medium
P3 Low
accessibility
backend
bug
content
data-integrity
enhancement
frontend
infra
integration
owner
owner-input
performance
performance
phase-7
phase-8
security
seo
ui
ux
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: null/Queue-North-Website#125
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Home.jsx uses two different patterns for rendering icons:
Services (line 300-315): Uses explicit conditional rendering (
service.icon === 'message-circle' && <MessageCircle .../>). If a new service is added with an icon not in the list, no icon renders — but it doesn't crash.Industries (line 409): Uses dynamic lookup
industryIcons[industry.icon]. Ifindustry.iconis not in theindustryIconsmap,IconComponentisundefined, and<IconComponent .../>will throw a React error:Element type is invalid: expected a string or a class/function but got: undefined.The industryIcons map only has 6 entries. Adding a new industry with a new icon string without updating the map will crash the entire page.
Fix
Add a fallback in the dynamic lookup:
Or better yet, use the same conditional rendering pattern as services for consistency.
Files
Severity
Medium — adding a new industry without updating the icon map will crash the Home page