Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 8, 2021. It is now read-only.

Commit cfef977

Browse filesBrowse files
committed
[[ Bug 22711 ]] Fix crash when calling copy on non-field text chunk
This patch fixes a crash when calling copy on non-field text chunk. Now a suitable error is thrown if this is the case.
1 parent b527ae8 commit cfef977
Copy full SHA for cfef977

File tree

Expand file treeCollapse file tree

2 files changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-0
lines changed

‎docs/notes/bugfix-22711.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Fix crash when calling the `copy` command with a text chunk of a non-field object

‎engine/src/cmdsc.cpp

Copy file name to clipboardExpand all lines: engine/src/cmdsc.cpp
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ void MCClipboardCmd::exec_ctxt(MCExecContext& ctxt)
185185
return;
186186
}
187187

188+
if (t_obj_chunk . object -> gettype() != CT_FIELD)
189+
{
190+
ctxt . LegacyThrow(EE_CHUNK_BADCONTAINER);
191+
return;
192+
}
193+
188194
if (iscut())
189195
MCPasteboardExecCutTextToClipboard(ctxt, t_obj_chunk);
190196
else

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.