diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index 05f9125c6ec1..ae7af539ad73 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -653,16 +653,19 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) return; } - std::unique_ptr pNewArgs = pNewAttrs->Clone(); - lcl_convertStringArguments(nSlot, pNewArgs); - - if(nEEWhich && pNewAttrs) + std::unique_ptr pNewArgs = pNewAttrs ? pNewAttrs->Clone() : nullptr; + if (pNewArgs) { - std::unique_ptr pNewItem(pNewArgs->Get(nWhich).CloneSetWhich(nEEWhich)); - pNewArgs->Put(*pNewItem); - } + lcl_convertStringArguments(nSlot, pNewArgs); - SetAttrToMarked(*pNewArgs); + if (nEEWhich) + { + std::unique_ptr pNewItem(pNewArgs->Get(nWhich).CloneSetWhich(nEEWhich)); + pNewArgs->Put(*pNewItem); + } + + SetAttrToMarked(*pNewArgs); + } GetView().GetViewFrame()->GetBindings().InvalidateAll(false);