Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/components/debugger/CallStackPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export function CallStackPanel() {
};

const handleCopyStack = async () => {
// Guard: do not overwrite clipboard when there are no frames
if (frames().length === 0) return;
const text = frames()
.map((f) => {
const loc = f.source?.path ? `${f.source.path}:${f.line}${f.column > 0 ? `:${f.column}` : ""}` : "unknown";
Expand All @@ -162,7 +164,7 @@ export function CallStackPanel() {
<Icon name={showThreads() ? "eye" : "eye-slash"} size={12} />
</IconButton>
</Show>
<IconButton size="sm" variant="ghost" onClick={handleCopyStack} title="Copy Call Stack">
<IconButton size="sm" variant="ghost" onClick={handleCopyStack} disabled={frames().length === 0} title="Copy Call Stack">
<Icon name="copy" size={12} />
</IconButton>
</div>
Expand Down