toolkit/source/controls/unocontrols.cxx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
New commits: commit a3bbdfab809609bec3475613a918eda699fbdc29 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Sep 16 16:05:30 2022 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Sep 16 22:14:07 2022 +0200 tdf#150974 Writer crashes when starting with WollMux installed regression from commit b2aa646ef09dc8434d3ca8a5bba53a8d8ff3f910 Author: Caolán McNamara <caol...@redhat.com> Date: Wed Dec 15 11:43:32 2021 +0000 use more OInterfaceContainerHelper3 in toolkit Change-Id: I26532ea79b7c5f750b4bf693881cbf41aeb82266 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140077 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 3bc095cf3f03..84fe8ce50774 100644 --- a/toolkit/source/controls/unocontrols.cxx +++ b/toolkit/source/controls/unocontrols.cxx @@ -270,11 +270,23 @@ void UnoEditControl::textChanged(const awt::TextEvent& e) void UnoEditControl::addTextListener(const uno::Reference< awt::XTextListener > & l) { + // tdf#150974 some extensions pass null + if (!l) + { + SAL_WARN("toolkit", "null XTextListener"); + return; + } maTextListeners.addInterface( l ); } void UnoEditControl::removeTextListener(const uno::Reference< awt::XTextListener > & l) { + // tdf#150974 some extensions pass null + if (!l) + { + SAL_WARN("toolkit", "null XTextListener"); + return; + } maTextListeners.removeInterface( l ); } @@ -767,6 +779,13 @@ void UnoButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToo void UnoButtonControl::addActionListener(const uno::Reference< awt::XActionListener > & l) { + // tdf#150974 some extensions pass null + if (!l) + { + SAL_WARN("toolkit", "null XActionListener"); + return; + } + maActionListeners.addInterface( l ); if( getPeer().is() && maActionListeners.getLength() == 1 ) { @@ -777,6 +796,13 @@ void UnoButtonControl::addActionListener(const uno::Reference< awt::XActionListe void UnoButtonControl::removeActionListener(const uno::Reference< awt::XActionListener > & l) { + // tdf#150974 some extensions pass null + if (!l) + { + SAL_WARN("toolkit", "null XActionListener"); + return; + } + if( getPeer().is() && maActionListeners.getLength() == 1 ) { uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );