fix(ui): add null check for roadmap.targetAudience to prevent crash
The RoadmapHeader component crashed with "Cannot read properties of undefined (reading 'primary')" when roadmap.targetAudience was not yet populated. Added defensive null check to prevent black screen. Closes #84 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
87e12cf627
commit
39a08f6117
@@ -65,30 +65,32 @@ export function RoadmapHeader({ roadmap, competitorAnalysis, onAddFeature, onRef
|
||||
</div>
|
||||
|
||||
{/* Target Audience */}
|
||||
<div className="mt-4 flex items-center gap-4 text-sm">
|
||||
<div className="flex items-center gap-2">
|
||||
<Users className="h-4 w-4 text-muted-foreground" />
|
||||
<span className="text-muted-foreground">Target:</span>
|
||||
<span className="font-medium">{roadmap.targetAudience.primary}</span>
|
||||
{roadmap.targetAudience && (
|
||||
<div className="mt-4 flex items-center gap-4 text-sm">
|
||||
<div className="flex items-center gap-2">
|
||||
<Users className="h-4 w-4 text-muted-foreground" />
|
||||
<span className="text-muted-foreground">Target:</span>
|
||||
<span className="font-medium">{roadmap.targetAudience.primary}</span>
|
||||
</div>
|
||||
{roadmap.targetAudience.secondary?.length > 0 && (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="text-muted-foreground cursor-help underline decoration-dotted">
|
||||
+{roadmap.targetAudience.secondary.length} more personas
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="max-w-md">
|
||||
<div className="space-y-1">
|
||||
<div className="font-semibold mb-2">Secondary Personas:</div>
|
||||
{roadmap.targetAudience.secondary.map((persona) => (
|
||||
<div key={persona} className="text-sm">• {persona}</div>
|
||||
))}
|
||||
</div>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
{roadmap.targetAudience.secondary.length > 0 && (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="text-muted-foreground cursor-help underline decoration-dotted">
|
||||
+{roadmap.targetAudience.secondary.length} more personas
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent className="max-w-md">
|
||||
<div className="space-y-1">
|
||||
<div className="font-semibold mb-2">Secondary Personas:</div>
|
||||
{roadmap.targetAudience.secondary.map((persona) => (
|
||||
<div key={persona} className="text-sm">• {persona}</div>
|
||||
))}
|
||||
</div>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Stats */}
|
||||
<div className="mt-4 flex items-center gap-6">
|
||||
|
||||
Reference in New Issue
Block a user