vcl/source/window/window.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e025317cc357d11e8c4afc35fbd5bacba4a07f4e
Author:     Michael Meeks <michael.me...@collabora.com>
AuthorDate: Fri Jul 9 15:14:50 2021 +0100
Commit:     Michael Meeks <michael.me...@collabora.com>
CommitDate: Wed Jul 14 10:54:23 2021 +0200

    vcl: make get_id safe for disposed windows.
    
    crash from:
            findChild(vcl::Window*, rtl::OUString const&, bool)      
include/rtl/ustring.hxx:1744
            WindowUIObject::get_visible_child(rtl::OUString const&)  
/vcl/source/uitest/uiobject.cxx:463
            lcl_sendDialogEvent ...
    
    Change-Id: Ic1756c7b03f2dee9780fb1a735917f1d0fc11876
    Signed-off-by: Michael Meeks <michael.me...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118691
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 303c46e2394f6b744f0df5e8e55a8e1cd8e22a91)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118802

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index fa029f89400f..4ec17ae8b18f 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3917,7 +3917,8 @@ void Window::set_id(const OUString& rID)
 
 const OUString& Window::get_id() const
 {
-    return mpWindowImpl->maID;
+    static OUString empty;
+    return mpWindowImpl ? mpWindowImpl->maID : empty;
 }
 
 FactoryFunction Window::GetUITestFactory() const
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to