Spaces:
Sleeping
Sleeping
copilot-swe-agent[bot] ArnavSingh76533 commited on
Commit ·
9dddb8e
1
Parent(s): a930f4f
Fix potential runtime errors with optional chaining for item.src access
Browse filesCo-authored-by: ArnavSingh76533 <160649079+ArnavSingh76533@users.noreply.github.com>
components/playlist/PlaylistItem.tsx
CHANGED
|
@@ -120,7 +120,7 @@ const PlaylistItem: FC<Props> = ({
|
|
| 120 |
|
| 121 |
return (
|
| 122 |
<Draggable
|
| 123 |
-
key={item.src[0].src + "-" + index}
|
| 124 |
draggableId={"playlistMenu-item-" + index}
|
| 125 |
index={index}
|
| 126 |
>
|
|
@@ -187,7 +187,7 @@ const PlaylistItem: FC<Props> = ({
|
|
| 187 |
</div>
|
| 188 |
{/* URL */}
|
| 189 |
<div className="text-xs text-dark-500 truncate">
|
| 190 |
-
{item.src[0]?.src || 'Unknown URL'}
|
| 191 |
</div>
|
| 192 |
</div>
|
| 193 |
|
|
@@ -213,7 +213,7 @@ const PlaylistItem: FC<Props> = ({
|
|
| 213 |
)}
|
| 214 |
</ControlButton>
|
| 215 |
<NewTabLink
|
| 216 |
-
href={item.src[0].src}
|
| 217 |
className={"p-1 text-dark-400 hover:text-primary-500 transition-colors"}
|
| 218 |
title="Open in new tab"
|
| 219 |
>
|
|
|
|
| 120 |
|
| 121 |
return (
|
| 122 |
<Draggable
|
| 123 |
+
key={(item.src?.[0]?.src || 'unknown') + "-" + index}
|
| 124 |
draggableId={"playlistMenu-item-" + index}
|
| 125 |
index={index}
|
| 126 |
>
|
|
|
|
| 187 |
</div>
|
| 188 |
{/* URL */}
|
| 189 |
<div className="text-xs text-dark-500 truncate">
|
| 190 |
+
{item.src?.[0]?.src || 'Unknown URL'}
|
| 191 |
</div>
|
| 192 |
</div>
|
| 193 |
|
|
|
|
| 213 |
)}
|
| 214 |
</ControlButton>
|
| 215 |
<NewTabLink
|
| 216 |
+
href={item.src?.[0]?.src || '#'}
|
| 217 |
className={"p-1 text-dark-400 hover:text-primary-500 transition-colors"}
|
| 218 |
title="Open in new tab"
|
| 219 |
>
|