From: Carlos Lopez Date: Sun, 29 Aug 2010 08:19:19 +0000 (+0200) Subject: Fix possible crash when right click on a Paste Canvas Layer that doesn't have a canva... X-Git-Url: https://git.pterodactylus.net/?p=synfig.git;a=commitdiff_plain;h=2e1323e91d3d46dca7f156078e7702aff3875897 Fix possible crash when right click on a Paste Canvas Layer that doesn't have a canvas set --- diff --git a/synfig-studio/src/synfigapp/actions/layerparamsetstatic.cpp b/synfig-studio/src/synfigapp/actions/layerparamsetstatic.cpp index 7676f41..974d3c8 100644 --- a/synfig-studio/src/synfigapp/actions/layerparamsetstatic.cpp +++ b/synfig-studio/src/synfigapp/actions/layerparamsetstatic.cpp @@ -102,7 +102,7 @@ Action::LayerParamSetStatic::is_candidate(const ParamList &x) //! Retrieves the current parameter parameter = _layer->get_param(_param_name); //! Check that the parameter is not a inline canvas - if(parameter.get_type()==ValueBase::TYPE_CANVAS) + if(parameter.get_type()==ValueBase::TYPE_CANVAS && parameter.get(Canvas::Handle())) if(parameter.get(Canvas::Handle())->is_inline()) return false; //! Check if it is already static diff --git a/synfig-studio/src/synfigapp/actions/layerparamunsetstatic.cpp b/synfig-studio/src/synfigapp/actions/layerparamunsetstatic.cpp index 00fbc10..08cc5f8 100644 --- a/synfig-studio/src/synfigapp/actions/layerparamunsetstatic.cpp +++ b/synfig-studio/src/synfigapp/actions/layerparamunsetstatic.cpp @@ -104,7 +104,7 @@ Action::LayerParamUnSetStatic::is_candidate(const ParamList &x) parameter = _layer->get_param(_param_name); //! Check that the parameter is not a inline canvas if(parameter.get_type()==ValueBase::TYPE_CANVAS) - if(parameter.get(Canvas::Handle())->is_inline()) + if(parameter.get(Canvas::Handle())->is_inline() && parameter.get(Canvas::Handle())) return false; //! Check if it is not static if(!parameter.get_static())