Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/notes/bugfix-21582.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fix crash and stack corruption when opening a stack that has a colorswatch widget
5 changes: 5 additions & 0 deletions engine/src/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,12 @@ IO_stat MCWidget::save(IO_handle p_stream, uint4 p_part, bool p_force_ext, uint3
// Make the widget generate a rep.
MCAutoValueRef t_rep;
if (m_widget != nil)
{
MCWidgetOnSave(m_widget, &t_rep);
// A widget might not have an OnSave handler (e.g. colorswatch widget)
if (*t_rep == nil)
t_rep = kMCNull;
}
else if (m_rep != nil)
t_rep = m_rep;
else
Expand Down