From 3c351d40c86488ee6d2eb22e6a84febca9738b04 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Fri, 14 Sep 2018 12:02:53 +0300 Subject: [PATCH 1/2] [21582] Fix crash when saving a stack that has a colorswatch widget --- engine/src/widget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/src/widget.cpp b/engine/src/widget.cpp index 3cc214cca74..228bff4c664 100644 --- a/engine/src/widget.cpp +++ b/engine/src/widget.cpp @@ -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 From 833a0be85b6c889e5555dac243c82b2c4e3aacd5 Mon Sep 17 00:00:00 2001 From: livecodepanos Date: Fri, 14 Sep 2018 12:34:58 +0300 Subject: [PATCH 2/2] [21582] Added bugfix note --- docs/notes/bugfix-21582.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/notes/bugfix-21582.md diff --git a/docs/notes/bugfix-21582.md b/docs/notes/bugfix-21582.md new file mode 100644 index 00000000000..06988fb39f4 --- /dev/null +++ b/docs/notes/bugfix-21582.md @@ -0,0 +1 @@ +# Fix crash and stack corruption when opening a stack that has a colorswatch widget