X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fsavecanvas.cpp;h=6129f7120f9a18805f09fe182e1c97986fa91f3f;hb=1cc17a4ac143e337dc4bb2b1d9514a085bced7af;hp=5bfd6ec92ea3881f7607e34f8cc15f4fc4e92250;hpb=b134716b4429e5fd53f9d01fa3caae7ecc81f6d9;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/savecanvas.cpp b/synfig-core/trunk/src/synfig/savecanvas.cpp index 5bfd6ec..6129f71 100644 --- a/synfig-core/trunk/src/synfig/savecanvas.cpp +++ b/synfig-core/trunk/src/synfig/savecanvas.cpp @@ -583,16 +583,25 @@ xmlpp::Element* encode_layer(xmlpp::Element* root,Layer::ConstHandle layer) continue; } - if(value.get_type()==ValueBase::TYPE_CANVAS && !value.get(Canvas::LooseHandle())->is_inline()) + if(value.get_type()==ValueBase::TYPE_CANVAS) { - Canvas::Handle child(value.get(Canvas::LooseHandle())); + // the ->is_inline() below was crashing if the canvas + // contained a PasteCanvas with the default Canvas setting; this avoids the crash + if (!value.get(Canvas::LooseHandle())) + continue; + + if (!value.get(Canvas::LooseHandle())->is_inline()) + { + Canvas::Handle child(value.get(Canvas::LooseHandle())); - if(!value.get(Canvas::Handle())) + if(!value.get(Canvas::Handle())) + continue; + xmlpp::Element *node=root->add_child("param"); + node->set_attribute("name",iter->get_name()); + node->set_attribute("use",child->get_relative_id(layer->get_canvas())); continue; - xmlpp::Element *node=root->add_child("param"); - node->set_attribute("name",iter->get_name()); - node->set_attribute("use",child->get_relative_id(layer->get_canvas())); - continue; + } } xmlpp::Element *node=root->add_child("param"); node->set_attribute("name",iter->get_name());